In lesson 3, we will create our first project by programming the Uno board and blinking an LED. We will make the LED blink by turning it ON, waiting for a second and then switching OFF. By repeating this sequence the led will blink with a 1-second interval.
The code looks something like this:
loop { //This statement will make the code inside loop forever
digitalWrite(LED,HIGH); //This line of code turns the LED ON
delay(1000); // This will create a 1 sec (1000 milliseconds) delay
digitalWrite(LED,LOW); //Turn the LED OFF
delay(1000); //Wait another second before starting the sequence again.
}
If this is the first time you are near any piece of code we would suggest going to the official Arduino Foundations to get started and gain some programming skills. On the above link there a quite a few guides and general information for first-timers.
Now, let's get our hands dirty! Launch the Arduino application that you installed on Lesson 2.
If you disconnected your board, plug it back in.
Open the Blink example sketch by going to File > Examples > 01.Basics > Blink
Select the type of board you’re using: Tools > Board > UNO
Select the serial port that your Arduino is attached to Tools > Port > xxxxxx (it’ll probably look something like “COMX” in Windows or "/dev/ttyusbmodxxx" if you are using a MAC.
If you’re not sure which serial device is your Arduino, take a look at the available ports, then unplug your Arduino and look again. The one that disappeared is your Arduino.
With your Arduino board connected and the Blink sketch open, press the ‘Upload’ button
After a second, you should see some LEDs flashing on your Arduino, followed by the message ‘Done Uploading’ in the status bar of the Blink sketch.
If everything worked, the onboard LED on your Arduino should now be blinking! You just programmed your first Arduino!
Now go ahead and try a few different examples. The Arduino environment has quite a few examples. Get familiarized with the programming language and the way the program works.
If you want to dig in on the Arduino functions and tools we recommend to read the Extended Reference Guide
Comments
0 comments
Please sign in to leave a comment.