Advertisement
microrobotics

CT0046LCD

Sep 9th, 2017
3,350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1.  #include <Wire.h>
  2.  #include "LiquidCrystal.h"
  3.  
  4. // Connect via i2c, default address #0 (A0-A2 not jumpered)
  5. LiquidCrystal lcd(0);
  6.  
  7. void setup() {
  8.   // set up the LCD's number of rows and columns:
  9.   lcd.begin(16, 2);
  10.   // Print a message to the LCD.
  11.   lcd.print("hello, world!");
  12. }
  13.  
  14. void loop() {
  15.   // set the cursor to column 0, line 1
  16.   // (note: line 1 is the second row, since counting begins with 0):
  17.   lcd.setCursor(0, 1);
  18.   // print the number of seconds since reset:
  19.   lcd.print(millis()/1000);
  20.  
  21.   lcd.setBacklight(HIGH);
  22.   delay(1000);
  23.   lcd.setBacklight(LOW);
  24.   delay(1000);
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement