Play a Melody using the tone() function with Arduino

This example shows how to use the tone() command to generate notes. It plays a little melody you may have heard before. Circuit image developed using Fritzing. For more circuit examples, see the Fritzing project page Connect one terminal of your speaker to digital pin 8 through a 100 ohm resistor. Connect the other terminal to ground. Schematic Code The code below uses an extra file, pitches.h. This file co ...

Read more

SPlaying tones on Multiple outputs using the tone() function with Arduino

This example shows how to use the tone() command to play different notes on multiple outputs. The tone() command works by taking over one of the Atmega's internal timers, setting it to the frequency you want, and using the timer to pulse an output pin. Since it's only using one timer, you can only play one note at a time. You can, however, play notes on multiple pins sequentially. To do this, you need to tu ...

Read more

Simple keyboard using the tone() function using Arduino

This example shows how to use the tone() command to generate different pitches depending on which sensor is pressed.   Circuit Connect one terminal of your speaker to digital pin 8 through a 100 ohm resistor, and its other terminal to ground. Power your three FSRs (or any other analog sensor) with 5V in parallel. Connect each sensor to analog pins 0-2, using a 10K resistor as a reference to groud on ea ...

Read more

Pitch follower using the tone() function using Arduino

This example shows how to use the tone() command to generate a pitch that follows the values of an analog input Circuit image developed using Fritzing. For more circuit examples, see the Fritzing project page Connect one terminal of your speaker to digital pin 9 through a 100 ohm resistor, and its other terminal to ground. Power your photoresistor with 5V, and connect it to analog 0 with the addition of a 4 ...

Read more
Scroll to top