In this experiment you will get an light emitting diode (LED) to flash repeatedly on and off for a second.
Take out your arduino board and USB cable and connect the arduino to your workstation as shown in the below diagram:
In the bottom left corner of the screen, click on the search icon to open the search window. Type "Arduino" and you should see the Arduino app in the search results. Click on the Arduino app to start it.
All going well, you should see something similar to the following:
You will use the Arduino App to write programs that will run on the Arduino Board. To connect your board to the app:
In the Arduino App, select Tools->Board and select "Arduino/Genuino Uno"
Select Tools->Port and select the port that says "Arduino/Genuino Uno".
We wire up the experiment as shown in figure 2.
Create a new sketch in Arduino IDE:
Enter the following code and upload it to the board:
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Click on the Upload button in the top left corner of the Arduino IDE. After a short time, you should see your LED start to blink.
Congratulations! You've created your first Arduino program.
Try the following challenges: