Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // SparkFun Serial LCD example 1
- // Clear the display and say "Hello World!"
- // This sketch is for Arduino versions 1.0 and later
- // If you're using an Arduino version older than 1.0, use
- // the other example code available on the tutorial page.
- // Use the softwareserial library to create a new "soft" serial port
- // for the display. This prevents display corruption when uploading code.
- #include <SoftwareSerial.h>
- // Attach the serial display's RX line to digital pin 2
- SoftwareSerial mySerial(3,2); // pin 2 = TX, pin 3 = RX (unused)
- void setup()
- {
- mySerial.begin(9600); // set up serial port for 9600 baud
- delay(500); // wait for display to boot up
- mySerial.write(254); // move cursor to beginning of first line
- mySerial.write(128);
- }
- void loop()
- {
- mySerial.write(254); // move cursor to beginning of first line
- mySerial.write (254);
- mySerial.write(128);
- mySerial.write(" "); // clear display
- mySerial.write(" ");
- mySerial.write(254); // move cursor to beginning of first line
- mySerial.write(128);
- mySerial.write (254);
- mySerial.write (254);
- mySerial.write (128);
- mySerial.write("Hallo Welt!");
- while(1); // wait forever
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement