1.

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 waveI had been asked this question during an online exam.My doubt is from Advanced Input Output in section Arduino Programming of Arduino

Answer»

Correct option is (d) To generate a square wave

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.



Discussion

No Comment Found

Related InterviewSolutions