Motoo Tanaka
/
test_MAX30205
test program for MAX30205, Human Body Temperature Sensor
test_MAX30205.cpp
- Committer:
- Rhyme
- Date:
- 2017-04-25
- Revision:
- 1:95dff95ef1b6
- Parent:
- 0:139b7922eade
File content as of revision 1:95dff95ef1b6:
#include "mbed.h" #include "MSS.h" #include "MAX30205.h" #define MAX30205_I2C_ADDRESS 0x48 int main() { uint16_t temp, thyst, tos ; MAX30205 *max30205 = new MAX30205(PIN_SDA, PIN_SCL, MAX30205_I2C_ADDRESS) ; printf("=== test MAX30205 for %s (%s) ===\n", BOARD_NAME, __DATE__) ; printf("Temp, Thyst, Tos\n") ; temp = max30205->getTemp() ; thyst = max30205->getThyst() ; tos = max30205->getTos() ; printf("%4.3f, %4.3f, %4.3f\n", (float)temp/256.0, (float)thyst/256.0, (float)tos/256.0) ; printf("Temperature (C degree)\n") ; while(1) { temp = max30205->getTemp() ; printf("%4.3f\n",(float)(temp)/256.0) ; wait(1) ; } }