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.The Seconds and the pauses are much faster when the millimeters are shorter.
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
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!Now its blinking very fast you can tell in the video but not really by the naked eye.
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
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
It looks like the light is spotted in some areas.The light is no longer blinkingNow 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
I think sense the light is blinking it would be natural for it to look spotty when moving back and forth.
The LED creates a dashed trail of light in the air. zWhat do you think is happening here?Highlight the text below to see the answer
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