LCD implementation of our project.
Dependencies: mbed mbed-rtos MLX90614
Diff: gyro.cpp
- Revision:
- 8:81ed1135ba02
- Parent:
- 6:49a007861c76
--- a/gyro.cpp Wed Jun 03 12:22:46 2015 +0000 +++ b/gyro.cpp Wed Jun 03 16:37:21 2015 +0000 @@ -2,7 +2,7 @@ //DigitalOut myled(LED1); //Serial pc(USBTX, USBRX); // tx, rx for USB debug printf to terminal console -I2C i2c(p28, p27); // LPC1768 I2C pin allocation +I2C i2c(p9, p10); // LPC1768 I2C pin allocation //DigitalIn din(p23); // used as a test button // Globals @@ -10,6 +10,13 @@ int16_t const Offset_mY=-115.0; float const RadtoDeg=(180.0/3.141592654); +MLX90614 IR_thermometer(&i2c); + +float get_temperature(void){ + float temp; + IR_thermometer.getTemp(&temp); + return temp; +} char readByte(char address, char reg) // Reads one byte from an I2C address