Experiment 3 Individual Report
Experiment 3 Individual Report
Ø What to expect: Lights will move from Left to Right then Right to Left,
continuously.
void loop() {
for (int i = 2; i < 9; i++) {
digitalWrite(i, HIGH);
delay(timer);
digitalWrite(i, LOW);
}
4. How would you change the amount of time each LED is ON?
The function “delay(ms)” pauses the program for the amount of time (in
milliseconds) specified as parameter. The ms in the function is responsible for
how many milliseconds the delay will last. For example “delay(1000)” would
provide a delay of 1 second as there are 1000 milliseconds in 1 second.
Through this experiment, the student was able to familiarize with the basic
operations of the Arduino Uno board and Integrated Development Environment
(IDE) and also know the basic functionalities of the IDE.
The experiment deals with creating a program in the Arduino that uses 8
pieces of LED’s in which the lights would move from left to right and vice-versa.
The procedure could be made by the regular digitalWrite() function however the
student used the for() function to make the code shorter and thus making it more
efficient in creating the program.