Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DS1820 TextLCD mbed
Fork of TextLCD_HelloWorld2 by
main.cpp
- Committer:
- wupinxian
- Date:
- 2017-03-19
- Revision:
- 5:7ed4428bc142
- Parent:
- 4:a3e4bb2053cb
File content as of revision 5:7ed4428bc142:
#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); } }