Maker Challenge number 1 Blinking LED
This week began the makerspace course I wanted in order to complete my masters in educational technology. In this course we will be working with the Arduino, which is an open source code program to create and upload the programs to our ELEGOO uno R3. This last thing is a small computer that comes with a bunch of cables and boards to work with. It is pretty awesome!
This week goal was to turn on an LED and make it blink for a certain amount of time.
The task was a success and the code was this one.Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Breaking it apart quick here. The first code INT for integers was the firts command entered and you give it a name. led because of the light and the 13 was the number of the pin on the elegoo uno r3.
The first part of the code gives that pin a purpose which is to let out power and turn on the led. The second part explains the loop of turning it on and off.
On this next part I'm going to add another line to add a series of leds on another pin just modifying the code.
This code was very fun to work with. This guys are a pain ===> } .. the brackets...
Now onto the blog post challenge...
int led = 13;
void setup() {
pinMode(led, OUTPUT);
}
void loop() {
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
}
HEre the proof!



Comments
Post a Comment