2

I'v looked at pyserial but I can't seem to figure out how to do it. I only need to send one at a time? Please help?

2 Answers 2

7

Using pySerial:

Python 2.x:

import serial
byte = 42
out = serial.Serial("/dev/ttyS0")  # "COM1" on Windows
out.write(chr(byte))

Python 3.x:

import serial
byte = 42
out = serial.Serial("/dev/ttyS0")  # "COM1" on Windows
out.write(bytes(byte))
Sign up to request clarification or add additional context in comments.

Comments

1

Google says:

  1. http://pyserial.sourceforge.net/
  2. http://balder.prohosting.com/ibarona/en/python/uspp/uspp_en.html

if you're using Uspp; to write on serial port documentation says

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.