Skip to content

Instantly share code, notes, and snippets.

@dpslwk
Last active December 19, 2015 09:59
Show Gist options
  • Save dpslwk/5937035 to your computer and use it in GitHub Desktop.
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----"
#!/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