Monday, November 16, 2015

Programming the LED

For part 4, our task for this part was to write programs that'll cause our breadboard to blink. To begin, we opened the Arduino Sketch and File. The first steps was getting our materials together. The materials used were: two jumper wires; a long orange wire, short black wire, a breadboard, Arduino, USB cord and resistors. To begin, I put the LED light and the resistor into the breadboard.  We then connected a long orange jumper wire and a short black jumper wire into the Arduino board. For the final step, we copied the code in the Sketch. A red light then flashed on and off.
















int red = 13;

void setup() {                

 // initialize the digital pin as an output.

 pinMode(red, OUTPUT);     

}

// the loop routine runs over and over again forever:
void loop() {
 digitalWrite(red, HIGH);   // turn the LED on (HIGH is the voltage level)
 delay(1000);               // wait for 1000 milliseconds = 1  second
 digitalWrite(red, LOW);    // turn the LED off by making the voltage LOW
 delay(1000);               // wait for a second
}


No comments:

Post a Comment