Last active
April 8, 2016 03:20
-
-
Save hunandy14/352bd562d7152dff1e05 to your computer and use it in GitHub Desktop.
RaspberryPi
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import serial | |
import os | |
os.system("sudo chmod 666 /dev/ttyAMA0") | |
Uart = serial.Serial("/dev/ttyAMA0", baudrate = 38400, timeout = 1) | |
Uart.write("Pi UART is already.") | |
print("Pi UART is already.") | |
while True: | |
UartSTR = Uart.readline() | |
if len(UartSTR) > 2: | |
print UartSTR, | |
Uart.write(UartSTR) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment