Last active
December 19, 2015 09:59
-
-
Save dpslwk/5937035 to your computer and use it in GitHub Desktop.
Very simple Python script to send first argument over serial
Usage: ./LLAPSend.py "a--HELLO----"
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import serial | |
import sys | |
import time | |
port = '/dev/ttyAMA0' | |
baud = 9600 | |
ser = serial.Serial(port=port, baudrate=baud) | |
time.sleep(0.5) | |
ser.write(sys.argv[1]) | |
time.sleep(0.5) | |
ser.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment