Professional Documents
Culture Documents
Review Questions
Review Questions
Write a program using timer1 interrupts that generates a servo pulse exactly every
20 ms with a given pulse width of exactly z (in microseconds). There are two
types of programs you should investigate.
A) Interrupts are disabled when making the 1-2 ms pulse width. What are the
advantages / disadvantages of this approach ?
B) Interrupts are used for both the rising edge and falling edge of the pulse. In this
case interrupts are not disabled when making the pulse. What are the advantages
/ disadvantages of this approach ?
Question #2
Verify the performance of the program from question #1 using a second Arduino
that uses a digital input and micros() to measure the pulse width (min, max,
average) using external interrupts. Compare the result to using:
https://www.arduino.cc/reference/en/language/functions/advanced-io/pulsein/
Also verify the performance of the servo library function. Try different servo pin
numbers to see if that affects the performance.
Question #3