Lesson 45--Microduino Electric Guitar

来自Microduino Wikipedia
1304410487@qq.com讨论 | 贡献2015年5月7日 (四) 08:30的版本 (Created page with "{| style="width: 800px;" |- | ==Objective== This tutorial will show you how to use ultrasonic sensor to make an electric guitar. ==Equipment== *'''Microduino-Core''' *''...")
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航搜索

Objective

This tutorial will show you how to use ultrasonic sensor to make an electric guitar.

Equipment

  • Other harware equipment
    • USB cable One
    • Ultrasonic sensor One
    • Loudspeaker One
    • 10KΩ resistor One
    • Breadboard jumpers several
    • Battern One


Note Frequency

We all know that the notes Do - Re - Mi - Fa - Sol - La - Si/Te have their correspsonding frequencies, seeing at the two tables below:

NoteFrequency1.jpg
NoteFrequency2.jpg


Schematic

ElectricGuitarSchematics.jpg


Program

guitar

In the program,int toneFrequency[]={415,440,466,494,523,554,587,622};

It is used to define the range and number that can generate notes. You can adjust the note frequency range according to individual needs.


Debugging

1. Download Tone library: Tone, and put it into libraries of IDE and then restart IDE. Compared with the built-in Tone, this Tone library can output waves with different frequency at the same time.


Caution: Decompress and change #include <wiring.h> in Tone.cpp to #include <Arduino.h>, or it'll cause errors.

2. Build the circuit according to schematic:

ElectricGuitarConnect.jpg

You can mark the location of notes accordin to note frequency on the battern.

3. Download and run the code

4. move the obstruction in front of ultrasonic and pay attention to the loudspeaker.

Result

The loudspeaker will generate different notes according to different locations of the obstruction, which is basically the same with the note on the battern.


Video