Question: A student uses the code below in a continuous loop to generate a 200 Hz square wave, noting the period of 200 Hz is 5
A student uses the code below in a continuous loop to generate a 200 Hz square wave, noting the period of 200 Hz is 5 ms.

He is then surprised to measure a frequency of 250 Hz. Explain why this is so.
redled = 1; wait_ms (2.5); redled = 0; wait_ms(2.5); // flash red led
Step by Step Solution
3.35 Rating (155 Votes )
There are 3 Steps involved in it
The code provided is meant to toggle an LED on and off to create a square wave The student sets the LED on with redLed 1 waits for 25 milliseconds set... View full answer
Get step-by-step solutions from verified subject matter experts
