MSS
/
test_HIH6130
test program for HIH6130, tested with MSS, MSU and FRDM-KL25Z
Embed:
(wiki syntax)
Show/hide line numbers
test_HIH6130.cpp
00001 #include "mbed.h" 00002 #include "MSS.h" 00003 #include "HIH6130.h" 00004 #define HIH6130_I2C_ADDRESS (0x27) 00005 00006 HIH6130 *hih6130 = 0 ; 00007 00008 int main() { 00009 float humidity = 0 ; 00010 float temperature = 0 ; 00011 00012 hih6130 = new HIH6130(PIN_SDA, PIN_SCL, HIH6130_I2C_ADDRESS) ; 00013 00014 printf("=== test HIH6130 for %s (%s) ===\n", BOARD_NAME, __DATE__) ; 00015 printf("Temperature(c), Humidity(%%)\n") ; 00016 00017 while(1) { 00018 hih6130->measure() ; 00019 wait(0.5) ; 00020 hih6130->getValue(&humidity, &temperature) ; 00021 printf("%.1f, %.1f\n", temperature, humidity) ; 00022 wait(1) ; 00023 } 00024 }
Generated on Thu Jul 14 2022 03:50:52 by 1.7.2