Question.7
What is the frequency of the PWM signal generated on digital pin 5 of Arduino UNO, after execution of the following code?
In the given code, the prescaler value of Timer0 is 1024.
Code
void setup() {
// Set prescaler of Timer0 to 1024
TCCR0B = (1 << CS02) | (1 << CS00);
}
void loop() {
for (int i = 0; i < 255; i++) {
analogWrite(5, i);
delay(1);
}
}