test code for hdc1080 humidity sensor

Dependencies:   hdc1080 mbed

Fork of Nucleo-F303K8-SSD1306_OLED by Joseph Ellsworth

main.cpp

Committer:
joeata2wh
Date:
2016-07-28
Revision:
4:53d68b18bd43
Parent:
3:47148198f5f2
Child:
5:3c91772b714e

File content as of revision 4:53d68b18bd43:

/* Example of Reading  TI HDC1080 sensor using STM F303K8 dev board

  NOTE:  As of 7/27/2016 with my custom board from seed studio I have
  been unsucesful getting a response from the sensor.  This may be due
  to bad soldering so ordered a pre-made module to see if it works. 

  By Joseph Ellsworth CTO of A2WH
  Take a look at A2WH.com Producing Water from Air using Solar Energy
  March-2016 License: https://developer.mbed.org/handbook/MIT-Licence
  Please contact us http://a2wh.com for help with custom design projects.

 */

#include "mbed.h"
#include <stdint.h>

//Pin Defines for I2C Bus
#define D_SDA                  PB_7 // specific for Nucleo-F303K8
#define D_SCL                  PB_6 // specific for Nucleo-F303K8
I2C i2c(D_SDA, D_SCL);
#include "hdc1080.h"


// Host PC Communication channels
Serial pc(USBTX, USBRX); // tx, rx
char buff[100];

DigitalOut myled(LED1);


int main()
{
    pc.baud(9600);
    while(1) {
        hdc_begin();
        hdc_readManufactId();
        hdc_readTemp();     
        hdc_readHumid();  
    }
}