Skip to content

Instantly share code, notes, and snippets.

@slayerjay
Created January 5, 2013 06:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save slayerjay/4460208 to your computer and use it in GitHub Desktop.
Save slayerjay/4460208 to your computer and use it in GitHub Desktop.
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
Serial.begin(9600);
lcd.begin(16, 2);
lcd.print("start");
}
void loop() {
if (Serial.available()) {
delay(100); //wait some time for the data to fully be read
lcd.clear();
while (Serial.available() > 0) {
char c = Serial.read();
lcd.write(c);
}
}
}
import serial
import time
s = serial.Serial(11, 9600) #port is 11 (for COM12, and baud rate is 9600
time.sleep(2) #wait for the Serial to initialize
s.write('Ready...')
while True:
str = raw_input('Enter text: ')
str = str.strip()
if str == 'exit' :
break
s.write(str)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment