dan59314
Published © Apache-2.0

Music Editing, Sent to Buzzer and Ultrasonic Gesture Control

Tired of playing single music in Arduino Buzzer? Unhappy with editing the notes and beats in Arduino source code?

BeginnerShowcase (no instructions)2 hours670
Music Editing, Sent to Buzzer and Ultrasonic Gesture Control

Things used in this project

Story

Read more

Schematics

Schematics

Code

Source Code

C/C++
//---------------------------------------------------------------------------------------------------

Step 1: Open a new sketch example, "UltraSonicGesture" from "danlib"

//---------------------------------------------------------------------------------------------------

Step 2: Add source code as following in setup() and loop().

#include <UltraSonicManage.h>

void setup() {

UltraSonicGesturer.Initial(cTrigPin, cEchoPin, &Process_WaveEvent);

}

void loop() {

UltraSonicGesturer.Check_WaveEvent();

}

//---------------------------------------------------------------------------------------------------

Step 3: Add your control code in Process_WaveEvent()

// Triggered if WaveEven ---------------------------------
void Process_WaveEvent(TUltraSonicGesturer*, TWaveState ws, int aCnt, float frDistCM, float toDistCM) {

switch (ws) {

case wsWaveIn: // Hand in 
// add your control code here......

break;

case wsWaveOut: // Hand

// add your control code here......

break;

case wsWave: // Hand in&Out

// add your control code here......

break;

case wsHolding: // Hand in, holding

// add your control code here......

break;

case wsHold: // Hand in , holding then out

// add your control code here......

break;

case wsNearToFar: // Hand in, holding from near to far

// add your control code here......

break;

case wsFarToNear: // Hand in, holding from far to near

// add your control code here......

break;

}

Credits

dan59314
0 projects • 0 followers
https://www.linkedin.com/in/daniel-lu-238910a4/
Contact

Comments

Please log in or sign up to comment.