Question

What is the delay time used in the program? (i.e., how long in seconds does the value of the pulsewidth remain constant before incrementing or decrementing?)

9int GREENPin- 10;I GREEN pin of the LED to PWM pin 10 10 it state = 0; 11 int delTime-50; 13 void dim (int gMin, int gMax, i

30 Methods 31 32 // Dim one or more led up or down· lf x Mino Max then dim led(s)up. Dim it(them) down otherwise 33 // lf x M

Digital Oscilloscope Trigger Channel Channel C Position AC 50DC Position AC 110DC 120 OFF 130 Invert A+B Level AC 0DC OFF 10

9int GREENPin- 10;I GREEN pin of the LED to PWM pin 10 10 it state = 0; 11 int delTime-50; 13 void dim (int gMin, int gMax, int dTime) 15 void setup 16 7 pinMode(GREENPin, OUTPUT) 18 Serial.begin(9600); 19 21 void loop 23 analogWrite (GREENPin, 0) start from Green LED OFF 25 / Dim up and down Green LED 26 dim(0, 255, delTime) 27 dim(255, 0, delTime); 28
30 Methods 31 32 // Dim one or more led up or down· lf x Mino Max then dim led(s)up. Dim it(them) down otherwise 33 // lf x MinsxMAx the correspondent led is kept at that brightness value, eg. gMin-200 and gMax=200 means Green at brightness-200 4 void dim (int gMin, int gMax, int dTime) 35 int gBrightness 36 boolean gEnd; 37 38 gEnd false; 9 Initial brightness values 40 gBrightness gMin; 41 42 while CgEnd) 43 analogWrite(GREENPin, gBrightness) delay(dTime) 45 47 Dim GREEN LED if (gMin,Max) gBrightness- gMax gEnd-true 56 57 --gBrightness if (gBrightness-,Max) gBrightness- gMax gEnd-true 59 61 62 63
Digital Oscilloscope Trigger Channel Channel C Position AC 50DC Position AC 110DC 120 OFF 130 Invert A+B Level AC 0DC OFF 10 30Invert One-Shot Cursors Source 10 A B C D 20 Horizontal Channel B Position AC DC GND 40 41 OFF Channel D Position AC 0DC Source A B C D 4) GND 210 200 190 50 Invert 110 Invert 0.5 1m mV V
0 0
Add a comment Improve this question Transcribed image text
Answer #1

We know that delay() function syntax is void delay(unsigned int milliseconds), It takes input as miliseconds

Your Code :


Line 11
delTime = 50 [means delTime is initialised to 50]


Line 45
delay(delTime) ---> Introduces a delay of 50 milliseconds


Hence in the program delay time used is 50 milliseconds

Thanks, PLEASE COMMENT if there is any concern. Let me know if you need more details/information

Add a comment
Know the answer?
Add Answer to:
What is the delay time used in the program? (i.e., how long in seconds does the value of the puls...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT