Thursday, August 27, 2015

Class Work Ex 2 & 3 (Aug 26) James Worthy

Exercise 1
Modify the code so that the light is on for 100 msec and off for 900 msec
 
 void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(900);              // wait for a second
}}Exercise 2.
Modify the code so that the light is on for 50 msec and off for 50 msec. What happens? 

Highlight the text below to see the answer 
The Seconds and the pauses are much faster when the millimeters are shorter.  
 void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(50);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(50);              // wait for a second
Intense strobe action!
Exercise 3. 
Modify the code so that the light is on for 10 ms and off for 10 ms. What happens?

Highlight the text below to see the answer 
Now its blinking very fast you can tell in the video but not really by the naked eye. 
 void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(10);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(10);              // wait for a second
The light is no longer blinking
Now pick up the Arduino and gently wave it back and forth, in a dark room. What happens?
Highlight the text below to see the answer 
It looks like the light is spotted in some areas. 

The LED creates a dashed trail of light in the air. z
What do you think is happening here?Highlight the text below to see the answer 
I think sense the light is blinking it would be natural for it to look spotty when moving back and forth. 

The LED is blinking, but its blinking so fast that our eyes can't pick it up, so it looks like a blur. When the Arduino is waved in the air, we see streaks of light from the blinks.

No comments:

Post a Comment