Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:55184eb43f43, committed 2017-04-03
- Comitter:
- u103060010
- Date:
- Mon Apr 03 15:44:37 2017 +0000
- Child:
- 1:d5115a30c51d
- Commit message:
- update code
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/APDS_9960.lib Mon Apr 03 15:44:37 2017 +0000 @@ -0,0 +1,1 @@ +https://developer.mbed.org/users/u103060010/code/APDS_9960/#8e5d2639d7bf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Apr 03 15:44:37 2017 +0000 @@ -0,0 +1,55 @@ +#include "mbed.h" +#include "glibr.h" + +glibr GSensor(D14,D15); +Serial pc(USBTX, USBRX); + +int isr_flag = 0; + +int main(void) +{ + + if ( GSensor.ginit() ) { + pc.printf("APDS-9960 initialization complete\r\n"); + } else { + pc.printf("Something went wrong during APDS-9960 init\r\n"); + return -1; + } + + // Start running the APDS-9960 gesture sensor engine + if ( GSensor.enableGestureSensor(true) ) { + pc.printf("Gesture sensor is now running\r\n"); + } else { + pc.printf("Something went wrong during gesture sensor init!\r\n"); + return -1; + } + + while(1) { + //pc.printf(".....\r\n"); + if ( GSensor.isGestureAvailable() ) { + switch ( GSensor.readGesture() ) { + case DIR_UP: + pc.printf("UP\r\n"); + break; + case DIR_DOWN: + pc.printf("DOWN\r\n"); + break; + case DIR_LEFT: + pc.printf("LEFT\r\n"); + break; + case DIR_RIGHT: + pc.printf("RIGHT\r\n"); + break; + case DIR_NEAR: + pc.printf("NEAR\r\n"); + break; + case DIR_FAR: + pc.printf("FAR\r\n"); + break; + default: + pc.printf("NONE\r\n"); + break; + } + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Apr 03 15:44:37 2017 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/mbed_official/code/mbed/builds/093f2bd7b9eb \ No newline at end of file