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

  • Stop wasting time looking for files and revisions. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.

View
 

Lab 2 Galyardt

Page history last edited by xinyi xie 6 years, 3 months ago

1.

a) The pin number (line 10)

b) The "delay" lines, 21 and 23

c) A switch and/or resistor

 

2.

a) Line 30, the pin assigned to ledPin, along with the other references to ledPin at 37, 50, and 54

b) 

const int buttonPin = 2;

const int led2 = 9; //the new LED

const int ledPin =  13;

 

int buttonState = 0;

 

void setup() {

  pinMode(ledPin, OUTPUT);

  pinMode(led2, OUTPUT);  

  pinMode(buttonPin, INPUT);     

}

 

void loop(){

  buttonState = digitalRead(buttonPin);

  if (buttonState == HIGH) {     

    digitalWrite(ledPin, HIGH);

    digitalWrite(led2, HIGH);   

  } 

  else {

    digitalWrite(ledPin, LOW);

    digitalWrite(led2, LOW);  

  }

}

3.

a) Nothing, the LED is already attached to pin 9

b) Change the +=5 and -=5 on fadeValue to something greater/less

c) Increase the delay on the lower and higher ends of the "brightness" spectrum, so that the the fading would appear to be more constant/linear

 

FRANKENLIGHT

 

1.

a) 5 - 3.2 = 1.8 V

1.8 V / 30mA = 60 ohms

Minimum 60 ohm resistor

2.

a) Yes, this is a TV remote, so something has to interpret the button presses and send a signal to the transmitter

b) Yes, there are touch sensors on the buttons that change the resistance when pressed, resulting in a change in voltage

c) The device is normally powered by AA batteries, and there appears to be some change of power going on through a voltage regulator. I'm not sure what the remote normally works on, but my LED lights up at around 7 volts.

d) Information does not appear to be stored on the device

 

Video

https://www.youtube.com/watch?v=Blt3Rj2Q7-o&feature=youtu.be

 

 

 

Comments (1)

xinyi xie said

at 5:04 pm on Jul 17, 2014

Great job!

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