![](/media/cache/profiles/4206e38996fae4028a26d43b24f68d32.jpg.50x50_q85.png)
A demo program for STTS751 (I2C temperature sensor library)
main.cpp
- Committer:
- takuo
- Date:
- 2014-01-18
- Revision:
- 0:de38b1558115
- Child:
- 1:8fb0961c0dc8
File content as of revision 0:de38b1558115:
/** 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); } }