APDS-9130 library
Revision 2:9db88ca586db, committed 2016-03-04
- Comitter:
- sleighton
- Date:
- Fri Mar 04 18:46:17 2016 +0000
- Parent:
- 1:159407640167
- Commit message:
- Before Tidy up
Changed in this revision
Prox.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Prox.cpp Sat Jan 30 20:33:17 2016 +0000 +++ b/Prox.cpp Fri Mar 04 18:46:17 2016 +0000 @@ -4,7 +4,7 @@ _sda = sda; _scl = scl; - WriteByte(0x72,0xE5); // Clear interrupt + WriteByte(0x72,0xE7); // Clear interrupt char PTIME; char WTIME; @@ -21,7 +21,7 @@ char PIHTL, PIHTH; //Upper interrupt threshold low and high bytes - PIHTL = 0xFF; + PIHTL = 0x01; PIHTH = 0x01; //trigger at 256 WriteByte (0x72, 0x0A, PIHTL); @@ -48,8 +48,11 @@ wait(0.12); //Wait for 120 ms } + + + uint16_t Prox::readProx(){ - WriteByte (0x72, 0xE5); //clear interrupt pin (untested) + WriteByte (0x72, 0xE7); //clear interrupt pin (untested) uint16_t prox; ReadWord(0x72, 0x18, &prox); return prox;