Motoo Tanaka / Mbed 2 deprecated test_MAX30205

Dependencies:   MAX30205 mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers test_MAX30205.cpp Source File

test_MAX30205.cpp

00001 #include "mbed.h"
00002 #include "MSS.h"
00003 #include "MAX30205.h"
00004 
00005 #define MAX30205_I2C_ADDRESS 0x48
00006 
00007 int main() {
00008     uint16_t temp, thyst, tos ;
00009     MAX30205 *max30205 = new MAX30205(PIN_SDA, PIN_SCL, MAX30205_I2C_ADDRESS) ;
00010     
00011     printf("=== test MAX30205 for %s (%s) ===\n", BOARD_NAME, __DATE__) ;
00012     printf("Temp,   Thyst,  Tos\n") ;
00013     temp  = max30205->getTemp() ;
00014     thyst = max30205->getThyst() ;
00015     tos   = max30205->getTos() ;
00016     printf("%4.3f, %4.3f, %4.3f\n", 
00017         (float)temp/256.0, (float)thyst/256.0, (float)tos/256.0) ;
00018     printf("Temperature (C degree)\n") ;
00019     while(1) {
00020         temp = max30205->getTemp() ;
00021         printf("%4.3f\n",(float)(temp)/256.0) ;
00022         wait(1) ;
00023     }
00024 }