Use IR Gesture Click which is based on 'APDS-9960' To learn more about IR Gesture key, please refer to "https://shop.mikroe.com/click/hmi/ir-gesture"

Dependencies:   APDS_9960 mbed

Files at this revision

API Documentation at this revision

Comitter:
u103060010
Date:
Mon Apr 03 16:05:25 2017 +0000
Parent:
0:55184eb43f43
Commit message:
add some command to make code more clear

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 55184eb43f43 -r d5115a30c51d main.cpp
--- a/main.cpp	Mon Apr 03 15:44:37 2017 +0000
+++ b/main.cpp	Mon Apr 03 16:05:25 2017 +0000
@@ -8,7 +8,7 @@
 
 int main(void)
 {
-    
+    // Initialize Sensor with I2C
     if ( GSensor.ginit() ) {
         pc.printf("APDS-9960 initialization complete\r\n");
     } else {
@@ -26,8 +26,8 @@
     
     while(1) {
         //pc.printf(".....\r\n");
-        if ( GSensor.isGestureAvailable() ) {
-            switch ( GSensor.readGesture() ) {
+        if ( GSensor.isGestureAvailable() ) {         // gesture detect
+            switch ( GSensor.readGesture() ) {        // gesture differentiate
                 case DIR_UP:
                     pc.printf("UP\r\n");
                     break;