Lab 2 Questions
Part B:
1A. What line(s) of code do you need to change to make the LED blink (like, at all)?
✔
1B. What line(s) of code do you need to change to change the rate of blinking?
✔
1C. What circuit element would you want to add to protect the board and LED?
✔
2A. Which lines do you need to modify to correspond with your button and LED pins?
✔
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?
✔
3B. How would you change the rate of fading?
✔
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?
✔
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.)
✔
No schematics -0.5
2A. Is there computation in your device? Where is it? What do you think is happening inside the "computer?"
✔
2B. Are there sensors on your device? How do they work? How is the sensed information conveyed to other portions of the device?
✔
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?
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.