test program for HIH6130, tested with MSS, MSU and FRDM-KL25Z

Dependencies:   HIH6130 mbed

test_HIH6130.cpp

Committer:
Rhyme
Date:
2017-04-18
Revision:
0:eb7b037f9295
Child:
2:c169837a0d3e

File content as of revision 0:eb7b037f9295:

#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) ;
    }
}