Description: Set Up The Software For The Arduino IDE and Write A Program That Blinks The LED Embedded Supplies
Description: Set Up The Software For The Arduino IDE and Write A Program That Blinks The LED Embedded Supplies
Description: Set Up The Software For The Arduino IDE and Write A Program That Blinks The LED Embedded Supplies
Description: Set up the software for the Arduino IDE and write a program that blinks the LED embedded
in the Arduino Uno board.
Supplies:
• Arduino Uno
• Arduino Uno USB cable
Constructs:
• Statements
Program description:
• Write a program that blinks the embedded LED located on digital pin 13 on the board every
second.
• In the setup() function, you will need to set pin 13 to output using the pinMode function.
• In the loop() function, you will need to do the following steps:
o turn the LED on (using digitalWrite)
o wait for a second (using delay)
o turn the LED off
o wait for another second
• To run the program, first click the check mark in the upper left hand corner to make sure that
the code compiles. (Alternatively, you can use the menu and choose Sketch → Verify/Compile)
• Next, if the code compiles, click the arrow to upload the code. (or use the menu to choose
Sketch → Upload)
• If your code compiles, but does not upload to the board there could be one of several issues:
o Go to the menu and choose Tools → Board and select Arduino Uno.
o Select a different serial port by going to Tools → Port and selecting the port associated
with the Arduino Uno.
o Unplug and re-plug in the Arduino
The code for the blink program is below. You can either add this code into your Arduino IDE, or you can
copy-and-paste from the website.
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.