WilsonTang_FrankenlightLab(2)


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

I would change the digitalWrite(led,HIGH) and digitalWrite(led,Low) and the delay lines.

To blink the light needs to be on delay until it goes off


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

I would change the delay to a smaller or larger time to change the rate of blinking.


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

Add a resistor to limit the voltage and current flowing through so it can’t blow up.

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

Lines:

 const int buttonPin = 2;     // the number of the pushbutton pin

const int ledPin =  9;      // the number of the LED pin


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.

// constants won't change. They're used here to 

// set pin numbers:

const int buttonPin = 2;     // the number of the pushbutton pin

const int ledPin =  13;      // the number of the LED pin

 

// variables will change:

int buttonState = 0;         // variable for reading the pushbutton status

 

void setup() {

  // initialize the LED pin as an output:

  pinMode(ledPin, OUTPUT);      

  // initialize the pushbutton pin as an input:

  pinMode(buttonPin, INPUT);     

}

 

void loop(){

  // read the state of the pushbutton value:

  buttonState = digitalRead(buttonPin);

 

  // check if the pushbutton is pressed.

  // if it is, the buttonState is HIGH:

  if (buttonState == HIGH) {     

    // turn LED off:    

    digitalWrite(ledPin,LOW);  

  } 

  else {

    // turn LED on:

    digitalWrite(ledPin, HIGH); 

  }

}

 

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

 Change the intledPin  =  ;  to whatever number your LED  is connected to.

b) How would you change the rate of fading?

I would change the fadeValue in the “for” functions.


c) (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?

 

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

 

  1. V= I*R

(5V – 3.2V) = R*(30/1000A)

R= 60 Ω


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

Yes, the Virtex -2 Pro XC2VP30 has a shiny silver computer in the center of the FPGA. Inside there it is controlling and relaying information.


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

No there are no sensors, only buttons and switches to turn things on and off.


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

There are internal and external power supplies. That can provide from 5v to 1.5v, they are dispersed through the system by the board and computer with many switches.


  1. Is information stored in your device? Where? How?

Yes there are RAM added and a slot for RAM. These can store information.

Please post a short video of your frankenlight to your lab report page. Include any schematics as well.

http://www.youtube.com/watch?v=_eEmzfVVCUk&feature=youtu.be