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.
Dependents: simple_gesture_test
Fork of APDS_9960 by
Revision 3:8e5d2639d7bf, committed 2017-04-03
- Comitter:
- u103060010
- Date:
- Mon Apr 03 15:41:56 2017 +0000
- Parent:
- 2:ba051af6731a
- Commit message:
- add some debug message;
Changed in this revision
| glibr.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/glibr.cpp Mon Apr 27 02:05:49 2015 +0000
+++ b/glibr.cpp Mon Apr 03 15:41:56 2017 +0000
@@ -1,11 +1,12 @@
#include "glibr.h"
#include "mbed.h"
+#include <iostream>
glibr::glibr(PinName sda, PinName scl):i2c(sda, scl){
- gesture_ud_delta_ = 0;
+ gesture_ud_delta_ = 0;
gesture_lr_delta_ = 0;
gesture_ud_count_ = 0;
@@ -28,6 +29,8 @@
id=I2CreadByte(APDS9960_I2C_ADDR, APDS9960_ID);
if( (!(id == APDS9960_ID_1 || id == APDS9960_ID_2))||id==ERROR) {
+ //printf("%c\r\n", id);
+ std::cout<<"fuck"<<std::endl;
return false;
}
@@ -2149,12 +2152,15 @@
char data; // store the register data
if(i2c.write(address<<1, &subAddress, 1, true)){
+ //std::cout<<"hello"<<std::endl;
return ERROR; //7 bit //not acked
}
if(i2c.read(address<<1, &data, 1)){ /////CHANGED THIS NEED TO TEST.
+ //std::cout<<"aloha"<<std::endl;
return ERROR;
}
+ //std::cout<<"Cheupei"<<std::endl;
//i2c.read(address<<1, &data, 1);
return data;
