no
Dependencies: DS1820 TextLCD mbed
Fork of TextLCD_HelloWorld2 by
main.cpp
- Committer:
- wupinxian
- Date:
- 2017-03-19
- Revision:
- 6:d7c691baf283
- Parent:
- 5:7ed4428bc142
File content as of revision 6:d7c691baf283:
#include "mbed.h" #include "stdio.h" #include "TextLCD.h" #include "DS1820.h" #include "NOKIA_5110.h" Serial pc(SERIAL_TX, SERIAL_RX); // set-up serial to pc PA2(TX) PA3(RX) DS1820 temp(A2); I2C i2c_lcd(D14,D15); // SDA, SCL TextLCD_I2C lcd(&i2c_lcd, 0x4e, TextLCD::LCD16x2); int main() { float x=0.0; i2c_lcd.frequency(100000); printf("test\n"); lcd.locate(0, 0); lcd.printf("test\n"); lcd.setBacklight(TextLCD::LightOn); printf("testing"); wait(5); while(1) { temp.convertTemperature(true,DS1820::all_devices); x=temp.temperature('C'); lcd.locate(0, 1); lcd.printf ("temp=%f ",x); wait(1); } }