answersLogoWhite

0


Best Answer

The TONE function on the Arduino generates a square wave on the specified pin based on the parameters specified. In other words, it quickly turns the pin on and off at the frequency specified. The syntax is:

Tone(p,f,d)

where p = the pin, f = the frequency in hertz (number of times per second) and d = duration to sound the tone in milliseconds (thousandths of a second). So, if you want to play the note middle C (about 260 hertz) for two seconds on pin 3 you would call:

Tone(3,260,2000)

In terms of hardware, you would need to connect a small speaker to the Arduino pin, one connection to the output pin (3 in our example) and the other speaker connection to ground (GND).

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you use the tone function on your Arduino?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What methods can you use to power and control a small electric motor using an Arduino without directly drawing power from the Arduino?

Have the Arduino control a relay that connects an external power source to the motor.


Which arduino kit you can use for biginner?

Generally I would recommend an "official" Arduino Uno as it is most likely to be completely compatible with the sketch (program) and you know it will work out of the box (compared to an Arduino clone/kit that you assemble). See Related Links for the official Arduino website as well as links to some resellers of the official Arduino Uno.


What is the use of arduino?

An Arduino is a microprocessor and circuit board that has been designed to make getting into working with microprocessors extremely easy. The Arduino project is open source to anyone can develop for it and there is a free tool that can be used to program the board.


Is arm and arduino the same?

No, Arduino is AVR. Not ARM.


How do you control the ground pin in an arduino?

There isn't any "control" of the ground pin - it is just that - the connection to the common ground. If you mean "How can you make a pin on Arduino go to LOW" (which is the same a zero volts of ground), use the pinMode() function to set a pin to OUTPUT and then issue a digitalWrite() command to that pin setting it to LOW


When did Pietro Arduino die?

Pietro Arduino died in 1805.


When was Pietro Arduino born?

Pietro Arduino was born in 1728.


When was Arduino Bertoldo born?

Arduino Bertoldo was born in 1932.


When was Arduino Berlam born?

Arduino Berlam was born in 1880.


When did Arduino Berlam die?

Arduino Berlam died in 1946.


When was Arduino created?

Arduino was created in 2005.


When did Arduino Bertoldo die?

Arduino Bertoldo died in 2012.