• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Browse and search Google Drive and Gmail attachments (plus Dropbox and Slack files) with a unified tool for working with your cloud files. Try Dokkio (from the makers of PBworks) for free. Now available on the web, Mac, Windows, and as a Chrome extension!


lab 2 questions

Page history last edited by zahraa@... 6 years ago

Lab 2 Questions

Part B:

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

  • You don’t need to change any lines of code to make the LED blink because the Arduino Micro board come preloaded with a version of the blink program on it and will automatically start blinking once connected to a power source.


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

  • The lines of code which begins with ‘delay’ must have their values changed to change the rate of blinking. Decreasing the value of the delay will make the rate of blinking fast and increasing the delay will make it slower.


1C. What circuit element would you want to add to protect the board and LED?

  • You would want to add a resistor to protect the board and the LED from short circuiting.


2A. Which lines do you need to modify to correspond with your button and LED pins?

  • You only need to modify the ‘const int ledPin’ line to pin 9 in order to correspond the button and LED pins because we altered the led output to 9 from 13.


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

  • const int buttonPin = 2;

  • const int ledPin = 9;

  • int buttonState = 0;

  • void setup() {

  • pinMode(ledPin, OUTPUT);

  • pinMode(buttonPin, INPUT);

  • }

  • void loop() {

  • buttonState = digitalRead(buttonPin);

  • if (buttonState == HIGH) {

  • digitalWrite(ledPin, LOW);

  • }

  • else {

  • digitalWrite(ledPin, HIGH);

  • }

  • }


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

  • I didn’t have to modify any of the lines of code because my current circuit was already connected to pin 9 which was describe in the Fade example code on Arduino.


3B. How would you change the rate of fading?

  • I would change the rate of fading by increasing or decrease the delay between the times of which I would wait before the LED started fading; increasing the delay time would make it fade slower and decreasing the delay time would make it fade quicker.


3C. Extra) 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?

  • I could change the code to make the light appear to fade linearly by making it change brightness one after another with breaks in between the different brightnesses.


Part C:

1A. What is the minimum resistor size that should be used with these LEDs? (Hint: think about your voltage supply and what the diode voltage drop means.)

  • The minimum resistor size that should be used with these LEDs would be a 60 olm resistor.

No schematics -0.5


2A. Is there computation in your device? Where is it? What do you think is happening inside the "computer?"

  • There is computation in my device, the device I am using is ram disk space where information is stored.



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

  • There are no sensors but information is sent to and from the rams because that is where information is kept, stored, and organized.



2C. 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 my being directed connected to the motherboard, which in turn is connected to a DC power supply. The motherboard regulates the amount of power which courses through its circuit using voltage regulators. Motherboards use 5 to 12V throughout the system.




2D. Is information stored in your device? Where? How?

  • Information is stored in my device in the ram columns, which are cells with millions of transistors and capacitors that, when paired together, create memory cells, which represents single bits of data.




Comments (1)

zahraa@... said

at 2:43 pm on Jul 14, 2015

good job

You don't have permission to comment on this page.