Learn How to Code! The Basics
|
We will start by just learning how to send code to the Arduino to make sure it works. You will also learn to name and save your files.
If you think you'll continue Arduino coding after camp, consider bringing a flash drive to save the code you make this week :) |
|
Open the Arduino software and plug in the Arduino board to your computer's USB. Type in the code below (without the // and after). \
Things after a // are not read by the computer, they are just comments so to tell people what the line of code does.
Follow instructor directions.
Things after a // are not read by the computer, they are just comments so to tell people what the line of code does.
Follow instructor directions.
When you are finished, click the check mark in the upper left. Upload your code to the Arduino by clicking the right arrow.
If you ever get an upload "Problem uploading to board" error, click Tools, then Port, and then select Arduino (shown below).
Once you see the onboard light blinking, you did it!
If you have time left over, play with the wait variable and upload it to see how it affects the light.
After you are done coding the onboard LED, save the file and open a new Arduino IDE code.
If you have time left over, play with the wait variable and upload it to see how it affects the light.
After you are done coding the onboard LED, save the file and open a new Arduino IDE code.