The software portion of this training is a very basic introduction to programming an Arduino microcontroller. Arduinos use a variation of the Wiring programming language, and Wiring is based on the Processing programming environment. Today's training will explain how to construct a basic Arduino script. There are two basic components of an Arduino script: void setup() and, (2) void loop().
In the basic below, used for reading values from a photocell through the serial port of the Arduino, the two basic components listed above are included:
The code above and a second script below form the basis for today's training. Please go to the GitHub page below and download the ZIP file containing the two scripts. See screen shot below link for additional help.
After downloading the files, open the Arduino IDE and open the serial_monitor script in the IDE. Playing with this script will provide an introduction to uploading code to the Arduino, and how to read sensor values from the serial monitor. The hands-on portion of this portion of the training will begin now.
This part of the training focuses on the code that controls the LED based on reading values from the Photocell (light sensor). This second section assumes that participants in the training have adequately constructed a breadboard layout as presented in the "hardware" section of this training, and it also assumes that participants have downloaded the ZIP file mentioned in the first component of the "software" section of this training.
Here is the code that will be uploaded and modified during this component of the training:
Now begins the second hands-on component for the "software" section of this tutorial.