What is the purpose of the tone() function?

What is the purpose of the tone() function?
A. To generate a sine wave
B. To generate a cosine wave
C. To generate a stable voltage level
D. To generate a square wave
 
Answer: D
Explanation: The tone() function is used to generate a square wave of 50% duty cycle. It accepts a maximum of 3 arguments; the pin number, the frequency, and the duration of the wave. If no duration is specified then the wave is continued to be generated until the noTone() function is invoked within the code.
 

Tìm kiếm

Back
Top