Advertisement
Guest User

Untitled

a guest
May 3rd, 2013
49
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // SparkFun Serial LCD example 1
  2. // Clear the display and say "Hello World!"
  3.  
  4. // This sketch is for Arduino versions 1.0 and later
  5. // If you're using an Arduino version older than 1.0, use
  6. // the other example code available on the tutorial page.
  7.  
  8. // Use the softwareserial library to create a new "soft" serial port
  9. // for the display. This prevents display corruption when uploading code.
  10. #include <SoftwareSerial.h>
  11.  
  12. // Attach the serial display's RX line to digital pin 2
  13. SoftwareSerial mySerial(3,2); // pin 2 = TX, pin 3 = RX (unused)
  14.  
  15. void setup()
  16. {
  17. mySerial.begin(9600); // set up serial port for 9600 baud
  18. delay(500); // wait for display to boot up
  19. mySerial.write(254); // move cursor to beginning of first line
  20. mySerial.write(128);
  21. }
  22.  
  23. void loop()
  24. {
  25. mySerial.write(254); // move cursor to beginning of first line
  26. mySerial.write (254);
  27. mySerial.write(128);
  28.  
  29. mySerial.write(" "); // clear display
  30. mySerial.write(" ");
  31.  
  32. mySerial.write(254); // move cursor to beginning of first line
  33. mySerial.write(128);
  34.  
  35.  
  36. mySerial.write (254);
  37. mySerial.write (254);
  38. mySerial.write (128);
  39. mySerial.write("Hallo Welt!");
  40.  
  41. while(1); // wait forever
  42. }
Advertisement
RAW Paste Data Copied
Advertisement