/* Program 3-4 Example of Cursor Control using Library Function LiquidCrystal(rs, enable, d4, d5, d6, d7) * This program uses LiquidCrystal library. For details of libraries: * https://www.arduino.cc/en/Reference/LiquidCrystal */ /* include the library code */ #include /* initialize the library with the numbers of the interface pins * LiquidCrystal(rs, enable, d4, d5, d6, d7) */ LiquidCrystal lcd(12, 11, 5, 4, 3, 2); void setup() { /* set up the LCD's number of columns and rows: */ lcd.begin(16, 2); } void loop() { float temp = 89.72; lcd.setCursor(3, 0); /* move cursor to first line fourth column */ lcd.print("Temperature"); delay(500); lcd.setCursor(5, 1); /* move cursor to second line sixth column */ lcd.print(temp, 2); /* display float number with two-digit fraction */ lcd.write(0xDF); /* degree sign */ lcd.print("F"); delay(1000); lcd.clear(); /* erase the display */ delay(1000); }