![](/media/cache/profiles/4206e38996fae4028a26d43b24f68d32.jpg.50x50_q85.png)
A demo program for STTS751 (I2C temperature sensor library)
Diff: main.cpp
- Revision:
- 0:de38b1558115
- Child:
- 1:8fb0961c0dc8
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sat Jan 18 02:33:45 2014 +0000 @@ -0,0 +1,28 @@ +/** A demo program for STTS751 (I2C temperature sensor library) + * Takuo WATANABE (wtakuo) + * http://mbed.org/users/takuo/code/ACM1602NI/ + */ + +#include "mbed.h" + +// I2C Text LCD: http://mbed.org/users/takuo/code/ACM1602NI/ +#include "ACM1602NI.h" +// I2C Temperature Sensor: http://mbed.org/users/takuo/code/STTS751/ +#include "STTS751.h" + +// I2C pins: p9 = sda, p10 = scl +ACM1602NI lcd(p9, p10); +STTS751 tmp(p9, p10); + +// You can specify an I2C object instead. +// I2C i2c(p9, p10); +// ACM1602NI lcd(i2c); +// STTS751 temp(i2c); + +int main() { + while (true) { + lcd.locate(0, 0); + lcd.printf("temp: %.3f", (float)temp); + wait(1); + } +}