Advertisement
Guest User

Untitled

a guest
Mar 4th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. #include < LiquidCrystal.h >
  2.  
  3. /*Connect LCD to Arduino:
  4. LCD -> Arduino
  5. --------------------------
  6. 1|VSS| -> Arduino GND
  7. 2|VDD| -> Arduino +5v
  8. 3|VO | -> Arduino GND pin + Resistor or Potentiometer
  9. 4|RS | -> Arduino pin 12
  10. 5|RW | -> Arduino GND - pin can be conected to 11. But Ground was used here.
  11. 6|E | -> Arduino pin 10
  12. 7|D0 | -> Arduino - Not Connected
  13. 8|D1 | -> Arduino - Not Connected
  14. 9|D2 | -> Arduino - Not Connected
  15. 10|D3 | -> Arduino - Not Connected
  16. 11|D4 | -> Arduino pin 5
  17. 12|D5 | -> Arduino pin 4
  18. 13|D6 | -> Arduino pin 3
  19. 14|D7 | -> Arduino pin 2
  20. 15|A | -> Arduino Pin 13 + Resistor (Backlight power)
  21. 16|K | -> Arduino GND (Backlight ground)
  22. */
  23.  
  24.  
  25. //Arduino scrolling text example
  26.  
  27. LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
  28. int backLight = 13; // pin 13 will control the backlight
  29.  
  30. void setup()
  31. {
  32. pinMode(backLight, OUTPUT); //set pin 13 as output
  33. analogWrite(backLight, 150); //controls the backlight intensity 0-254
  34.  
  35. lcd.begin(16,2); // columns, rows. size of display
  36. lcd.clear(); // clear the screen
  37. lcd.setCursor(0,0); // set cursor to column 0, row 0 (first row)
  38. lcd.print("Hello. Is there anybody out there?"); // input your text here
  39. lcd.setCursor(0,1); // move cursor down one
  40. lcd.print("www.abrushfx.com"); //input your text here
  41. }
  42.  
  43. void loop()
  44. {
  45. lcd.setCursor(16,1); // set the cursor outside the display count
  46. lcd.autoscroll(); // set the display to automatically scroll:
  47. lcd.print(" "); // print empty character
  48. delay(500);
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement