
nexpaq development module demo for MAX3010x sensor
Dependencies: MAX30105 nexpaq_mdk
Fork of ALS_Prox_Demo by
Temp Prox Demo
MAX32625NEXPAQ development module
This project is a demonstration application for the MAX32625NEXPAQ development module and a MAX3010x sensor.
This project demonstrates polling the proximity sensor to use it like a button and also polling the temperature sensor and sending the information back to the application running on the phone, and the phone controlling the threshold for the proximity sensor and controlling the on board RGB LED to create different colors.
nexpaq App Tile Files
Revision 9:b7cf4b7fd770, committed 2016-10-15
- Comitter:
- nexpaq
- Date:
- Sat Oct 15 19:07:22 2016 +0000
- Parent:
- 8:123fe6112b7a
- Child:
- 10:a81682ee3e73
- Commit message:
- Applied auto formatting
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Sep 23 18:47:07 2016 +0000 +++ b/main.cpp Sat Oct 15 19:07:22 2016 +0000 @@ -50,12 +50,12 @@ void sendALS() { unsigned char pData[3]; - max44000.writeReg(MAX44000::REG_MAIN_CONFIG, 0x20); + max44000.writeReg(MAX44000::REG_MAIN_CONFIG, 0x20); pData[0] = 10; pData[1] = max44000.readReg(MAX44000::REG_ALS_DATA_HIGH); pData[2] = max44000.readReg(MAX44000::REG_ALS_DATA_LOW); np_api_upload(0x2800, pData, 3); - max44000.writeReg(MAX44000::REG_MAIN_CONFIG, 0x30); + max44000.writeReg(MAX44000::REG_MAIN_CONFIG, 0x30); } /******************************************************************************/ @@ -75,18 +75,18 @@ { int proxData = max44000.readReg(MAX44000::REG_PRX_DATA); if (proxData > prxThrsh) { - if (!lastPrx) { + if (!lastPrx) { np_api_upload(0x2800, &prxPress, 1); } lastPrx = 1; } else { - lastPrx = 0; + lastPrx = 0; } - if (!button && lastBtn) { + if (!button && lastBtn) { np_api_upload(0x2800, &btnPress, 1); - } - lastBtn = button; + } + lastBtn = button; alsCnt += 1; if (alsCnt > ALS_INTERVAL) {