welcome to this first lesson about
learning Arduino
what you need for this episode is: an Arduino board, USB-cable and a computer
Let's get started!
so what is an Arduino? An Arduino is
a microcontroller
with a microcontroller you can read and write signals
these signals can be analog or digital
digital signals are only "true" / "false"
or "high" / "low"
the analog signals can vary, for example for temperature or variable resistors
which is what I'm going to show you in later episodes
first start with this Arduino board
I'm going to explain the components to you
on the front we have the USB connector
and a power plug
the power plug is used when you're using an external power supply
so for example if you don't have a computer nearby where you can plug in your USB cable
you can use this power socket
to connect an external adapter
to read digital and analog signals
we have to use pins. The pins are
all labeled: here we start with 13 and we
go all the way back to pin 0
these are digital pins, so these can become 1 or 0
it's also explained on the board itself
it says "digital" which means zeros and ones (HIGH/LOW)
on the bottom, we have analog inputs
the Arduino Uno doesn't have any analog outputs, 
we'll come to that later
here is a power section, the Arduino provides
5, 3.3V and ground (GND)
As you can see here is the 5V pin,
here is the 3.3V pin,
the 5V pin and various GND pins
the "Vin" is the voltage input
if you use an external power supply
and there is also here a "reset pin"
the nice thing about this Arduino Uno is that there is also an LED
here marked with the "L"
We can program this LED,
and that's what we're going to do in this tutorial
on the top we also have a reset button
if you press this one
the board will reset and start its
program all over again
Let's get started!
this is what we see when we first start
Arduino
this is also called the Arduino IDE
IDE means:
integrated development environment
so we already see a piece of code over here
and are some buttons on the top
but first I like to show you the "Preferences"
So what I like is "line numbers"
and I like to enable "code folding"
also I like to see a more extensive output when I'm running the code for uploading
so when applying this I'm now able to
collapse these sections
so what we're going to do
is we're going to make a LED blink
we can enter all the code by ourselves
but there is a very easy section in the IDE with examples
So we're going to "File"
Then "Examples", "basic" and "blink"
as you can see there are a lot of other examples using
sensors, displays, GSM, SD card readers etc.
we'll save these for later
so first we click on "blink" and a new sketch appears
this is actually very easy but
we're going to walk it through
first we start with a forward slash and an asterisk
it has an open and closed section
this is for multi-line comments
so the compiler of our code doesn't look
at this
the same goes if you use double slash
double slash means: ignore this line
but it's very useful to add comment
so as this line already says
the setup function runs once when you press 
the reset button or power the board
it is running once
so what they do here is to say we
want the "build in" LED pin set to output
so we're going to send something to it
and we're not going to read its value
so when we have set this LED pin
here usually you can set the pin number
we continue with a loop
when our program executes,
it infinitely loops through the instructions
 in the loop function
so what it is going to do is
it goes to digital write to the LED pin
I will make it high
high means 1 or means
there is current flowing through
so when we make the built in LED pin high
the LED will turn on
we continue with a delay of a
thousand milliseconds
well a thousand milliseconds is the same as one second
then we continue to write an other value
to the LED pin, which is LOW
so the LED turns off
then we add another delay
this means the LED goes on
wait for a second, then off, wait for a second
go back to the top of the loop and we'll continue
that's all for this sketch
so what we're now going to do is to connect our Arduino
and upload the sketch
best practice is to first verify the sketch
I click on this button and we'll see a lot
of things going on here
and that's verifying if our sketch is correct
well there are no errors here 
it says "done compiling"
so we know this code is correct
it doesn't mean that it will do,
what you think it will do
we're now done with this code
we can now connect our Arduino board 
to the USB
so it's time for you to connect your Arduino board to the USB port
in "tools" we'll see here that
I'm using an Arduino Genuine UNO
if you use a different one for example a
Nano or Leonardo
you have to check the board type here
I'll leave it to Arduino Uno
since I am using that one
then we have the ports
make sure you select the correct port of your Arduino
usually it looks something like this
like USB serial or it looks like Arduino
if this is all correct, we're going to 
upload the sketch to our Arduino board
so you press upload
and then you if I increase this screen a bit
then we can see here on the bottom 
"AVR done thank you"
so we know it is working
or if it uploaded correctly
but let's see what it all told us
it says which port it uses
it uses the Arudino programmer
it's the 18 mega 32 ATP chip
well then a lot of other stuff 
which is not really interesting
here we can see the firmware version
so if you look for the firmware version of your Arduino
you can see it here
and here you can see it's writing into flash
since this is a very small piece of code
it's done in 0.5 seconds
so if you look at your Arduino now
you'll see it is blinking
I am going to show you this now
our sketch is successfully uploaded
as you can see the LED is blinking 
on and off every second
that concludes our
tutorial for today
in the next episode
we are going to use a breadboard, LED 
and resistors
See you next time!
