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: glibr.cpp
- Revision:
- 10:e8adab2fb829
- Parent:
- 9:286d00d9db80
- Child:
- 11:ea43b0b83222
--- a/glibr.cpp Fri Mar 06 22:59:40 2015 +0000 +++ b/glibr.cpp Mon Mar 09 21:17:34 2015 +0000 @@ -431,15 +431,16 @@ if( !isGestureAvailable() || !(getMode() & 0x41) ) { return DIR_NONE; } + /* Keep looping as long as gesture data is valid */ while(1) { - + /* Wait some time to collect next batch of FIFO data */ wait(FIFO_PAUSE_TIME); /* Get the contents of the STATUS register. Is data still valid? */ - + gstatus=I2CreadByte(APDS9960_I2C_ADDR,APDS9960_GSTATUS); if( gstatus==ERROR ) { return ERROR; @@ -453,7 +454,6 @@ return ERROR; } - //#if DEBUG // Serial.print("FIFO Level: "); // Serial.println(fifo_level); @@ -469,6 +469,7 @@ if( check == -1 ) { return ERROR; } + #if DEBUG //Serial.print("FIFO Dump: "); for ( i = 0; i < (fifo_level * 4); i++ ) {