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... 

I figure that this blog runs as my brain runs and the previous thing was something I wanted to share. 

1. explanation of the project : make an led blink in the r3 and breadbox! using a loop code so it can go on forever! 
2. The code is here: 



int led = 13;

void setup() {                
  pinMode(led, OUTPUT);     
}

void loop() {
  
digitalWrite(led, HIGH);   
  
delay(1000);               
  
digitalWrite(led, LOW);    
  
delay(1000);               
}

HEre the proof! 


This was the result. 
Or diagram. 


The light turned on and off for the duration of 10000 ms. 

Video Explanation: bonus cheering squad in the back! 





Extension of the experiment 2 led's in the same loop. 


For this extension I had to copy and paste the same loop above but added another Integer and labeled it led_2, in addition I also used pin 12 for this next part. 
Here is the code: blurry... oops! just make sure you add another INT and variable led_2. and that everything falls under this bracket } and you should be fine. 






Reflection about this challenge. It was great to see the level of control you can easily get to and how everything in the code makes sense. What changed was the labels but a quick explanation made the variables and commands easy to remember. I don't expect every challenge to be as easy as this one. Another thing that I learned was the closing of a code function is marked by ending with this } 

On the extension video I added at the end i played with the code and added another pin and function to have two blinking leds. I found out that there is either less power because I used the same resistor and just a wire and the light was dimmed. 

In the loop code it is smart to remember that everything goes in that order or sequence so if you are going to add more they will take a second to light up. I'm looking at how to repeat the loop both of them at the same time. 

Great challenge! I really enjoyed it. Sorry for the mess of organization I have going on right here! 

Update: I added another output and voltage came the same making both lights the same brightness! 




Here is the video of the result: both lights blinking in a sequence. Next stop is having them both blink at the same time. 



Video of result 2 leds blinking in sequence

Wanted to just put the video here but didn't work. Promise it isn't no virus! 





Comments

Popular posts from this blog

Teach the younglings to design their games! !!!!