Jouer de la Musique à l'aide d'Arduino Esplora

This example shows how to play notes on the buzzer mounted on the Arduino Esplora. Buzzers can generate different audio signals in audible frequency ranges. A note is an audio signal at a specific frequency.

Play Music using Arduino Esplora

If you know the frequency of the notes you want to play, you can start to compose a melody.

In this example, you move the slider to generate different notes, and play them by pressing the down push-button.

Circuit

Only your Arduino Esplora is needed for this example. Connect the Esplora to your computer with a USB cable.

Play Music using Arduino Esplora circuit

slider to choose the note and push-button switch to play it

Code

There are 13 notes stored inside an tableau. You can choose the note to play by changing the position of the slider.

The index number that selects the value in the array is mapped to the position of the linear potentiometer. This number is the frequency of the note to play. Imagine the length of the potentiometer in split into 13 sections. Moving the slider from the right to the left will change the note when it crosses into a different section. Each section corresponds to a spot in the array, and a value to play on the buzzer.

To play the note you press the down direction button; it will play as long as the button is held.

 

/*
Esplora Music

This sketch turns the Esplora in a simple musical instrument.
Press the Switch 1 and move the slider to see how it works.

Created on 22 november 2012
By Enrico Gueli <[email protected]>
modified 22 Dec 2012
by Tom Igoe
*/
Major Components in Project

Hardware Required

  • Arduino Esplora

For more detail: Jouer de la Musique à l'aide d'Arduino Esplora


A Propos De L'Auteur

Ibrar Ayyub

Je suis expérimenté, rédacteur technique, titulaire d'une Maîtrise en informatique de BZU Multan, Pakistan à l'Université. Avec un arrière-plan couvrant diverses industries, notamment en matière de domotique et de l'ingénierie, j'ai perfectionné mes compétences dans la rédaction claire et concise du contenu. Compétent en tirant parti de l'infographie et des diagrammes, je m'efforce de simplifier des concepts complexes pour les lecteurs. Ma force réside dans une recherche approfondie et de présenter l'information de façon structurée et logique format.

Suivez-Nous:
LinkedinTwitter

Laisser un Commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

fr_FRFrench
Faire défiler vers le Haut