![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Uses the APDS_9960 Digital Proximity, Ambient Light, RGB and Gesture Sensor library to play detected gesture sounds on a speaker from the SDcard
Dependencies: mbed SDFileSystem wave_player
Diff: main.cpp
- Revision:
- 14:5e5994418e97
- Parent:
- 12:63c81930b5d9
- Child:
- 16:cd5666b8fa12
diff -r 5930645dc5f0 -r 5e5994418e97 main.cpp --- a/main.cpp Wed Mar 11 15:55:12 2015 +0000 +++ b/main.cpp Wed Mar 11 16:17:28 2015 +0000 @@ -39,12 +39,6 @@ FILE *Far; FILE *Near; - Up=fopen("/sd/up.wav","r"); - Down=fopen("/sd/down.wav","r"); - Left=fopen("/sd/left.wav","r"); - Right=fopen("/sd/right.wav","r"); - Far=fopen("/sd/far.wav","r"); - Near=fopen("/sd/near.wav","r"); // waver.play(wave_file); while(1) { /* ret = GSensor.isGestureAvailable(); @@ -56,26 +50,32 @@ switch ( GSensor.readGesture() ) { case DIR_UP: pc.printf("UP\n"); + Up=fopen("/sd/up.wav","r"); waver.play(Up); break; case DIR_DOWN: pc.printf("DOWN\n"); + Down=fopen("/sd/down.wav","r"); waver.play(Down); break; case DIR_LEFT: pc.printf("LEFT\n"); + Left=fopen("/sd/left.wav","r"); waver.play(Left); break; case DIR_RIGHT: pc.printf("RIGHT\n"); + Right=fopen("/sd/right.wav","r"); waver.play(Right); break; case DIR_NEAR: pc.printf("NEAR\n"); + Far=fopen("/sd/far.wav","r"); waver.play(Near); break; case DIR_FAR: pc.printf("FAR\n"); + Near=fopen("/sd/near.wav","r"); waver.play(Far); break; default: