//use integer variable to store pin # for LED (global variable) II connect LED t
ID: 3918811 • Letter: #
Question
//use integer variable to store pin # for LED (global variable) II connect LED this digital port/pin intledPina 10; // the setup) function runs once at startup void setup() pin 10 pinMode(ledPin, OUTPUT), Il initialize the digital pin as an output. LED // the loop routine runs over and over again forever void loop) GND digitalWrite(ledPin, HIGH); / turn the LED on delay(2); digitalWrite (ledPin, LOW), turn the LED off delay(8); Note: every LED needs a series resistor (200-1K ohms) I/ wait in msec / wait in msecExplanation / Answer
OnTime = Duration of time signal is HIGH
OffTime = Duration of time signal is LOW
Period = It is the sum of the OnTime and OffTime of PWM signal
Period = OnTime + OffTime
Duty Cycle = It is the percentage of the time signal that remains on during period of the PWM signal
Duty Cycle = OnTime / Period *100
a)
Duty Cycle of the blinking LED is 20%
Duty Cycle (%) = 2 / 10 * 100
Duty Cycle (%) = 20%
b)
Period (sec) of the blinking LED is 6 seconds
6000 milliseconds = 6 seconds
Period = 2000 + 4000
Period = 6000 milliseconds
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.