MSS
/
test_HIH6130
test program for HIH6130, tested with MSS, MSU and FRDM-KL25Z
Diff: test_HIH6130.cpp
- Revision:
- 0:eb7b037f9295
- Child:
- 2:c169837a0d3e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test_HIH6130.cpp Tue Apr 18 04:33:36 2017 +0000 @@ -0,0 +1,19 @@ +#include "mbed.h" +#include "MSS.h" +#include "HIH6130.h" +#define HIH6130_I2C_ADDRESS (0x27) + +int main() { + uint16_t result = 0 ; + float humidity = 0 ; + float temperature = 0 ; + HIH6130 hih(PIN_SDA, PIN_SCL, HIH6130_I2C_ADDRESS) ; + + printf("=== test HIH6130 for %s (%s) ===\n", BOARD_NAME, __DATE__) ; + + while(1) { + result = hih.getValue(&humidity, &temperature) ; + printf("Temp %.1f C Humidity %.1f %%\n", temperature, humidity) ; + wait(1) ; + } +}