Yaroslav Barabanov / Mbed 2 deprecated LiquidCrystal_I2C_for_Nucleo

Dependencies:   mbed

Dependents:   mbed-os-example-mbed6-wifi_MY_SOCKET_rigtech_copy_

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include <LiquidCrystal_I2C.h>
00003 
00004 // Set the LCD address to 0x27 for a 16 chars and 2 line display
00005 LiquidCrystal_I2C lcd(0x4E, 16, 2);
00006 
00007 
00008 
00009 int main()
00010 {
00011  
00012     // initialize the LCD
00013     lcd.begin();
00014 
00015     // Turn on the blacklight and print a message.
00016     lcd.backlight();
00017     lcd.print("Hello, world!");
00018     
00019     while (1) {
00020         /*
00021         // Read temperature register
00022         data_write[0] = LM75_REG_TEMP;
00023         i2c.write(LM75_ADDR, data_write, 1, 1); // no stop
00024         i2c.stop();
00025         wait(0.01);
00026         i2c.read(LM75_ADDR, data_read, 2, 0);
00027         i2c.stop();
00028 */
00029         wait(0.01);
00030     }
00031  
00032 }
00033