Lab 2: Frankenlight LED


Part B:

 

1) Blinking LEDs with Arduino Micro

     a) What line(s) of code do you need to change to make the LED blink (like, at all)?

         
No code needs to be changed for the onboard LED. The "digitalWrite()" function controls whether the light is on/off (HIGH/LOW).

     b) What line(s) of code do you need to change to change the rate of blinking?

 

          The "delay()" function tells the program to pause for a specified amount of time.  This is used to affect the rate of blinking.

     c) What circuit element would you want to add to protect the board and LED?

          

          A resistor should be used to protect the board and an external LED.

2) Toggle LEDs on and off using Arduino Micro

     a) Which lines do you need to modify to correspond with your button and LED pins?

 

          The ledPin constant needs to be changed to pin 9, not 13.

     b) Modify the code or the circuit so that the LED lights only while the button is depressed. Include your code in your lab write-up.

 

          You change the condition of the "if" statement.

 

          Code:

         

3) Fading LEDs on and off using Arduino Micro  

     a) Which line(s) of code do you need to modify to correspond with your LED pin?

 

          None.  The example already has the LED using pin 9, which is what we have been using.

     b) How would you change the rate of fading?

 

          You can change the delay to affect how fast the for loops runs, thereby changing the speed at which the "fadeValue" changes.  You can also change the increment of the for loop to make the steps of "fadeValue" to be bigger or smaller to reach the end value of the for loop faster or slower.

     c) Since the human eye doesn't see increases in brightness linearly and the diode brightness is also nonlinear with voltage, how could you change the code to make the light appear to fade linearly?

 

           *******

          

Part C:

 

1) Super bright LEDs

     a) What is the minimum resistor size that should be used with these LEDs?

 

          R_min = 60 Ohms

2) Take apart your electronic device, and draw a schematic of what is inside.

     Schematic:

         

     a) Is there computation in your device? Where is it? What do you think is happening inside the "computer?"

     

          Remote: Yes, there is a microcontroller on the PCB that handles the button presses.

     b) Are there sensors on your device? How do they work? How is the sensed information conveyed to other portions of the device?

 

          Every button on the remote is a sensor.

     c) How is the device powered? Is there any transformation or regulation of the power? How is that done? What voltages are used throughout the system?

 

          The device is powered by two AA batteries.  There is some power regulation through the device with resistors and capacitors.  3V were measured throughout the device.

     d) Is information stored in your device? Where? How?

 

          Information is stored on the microcontroller memory.

Part D:

 

Schematics:

          

 

Video: