I am attempting to send serial data to an Alpha Clock Five from a Python script running on a Raspberry Pi. I have version 1 hardware, but I have updated it first to stock version 2 firmware and now GPS with the AdaFruit GPS module. I will admit that I am new to Python programming. I was able to use the same cable to upgrade the firmware and run the Processing demos from a Windows PC. The code I have written in Python so far is below. The code runs and the clock resets with no change in brightness...
#!/usr/bin/python
#
# Rolf Mikkelson. 27-FEB-2013
#
import serial
header = chr(0xFF)
# print "header = ", header
myport=serial.Serial('/dev/ttyUSB0',19200)
tosend="B00111234567"
# print tosend
myport.write(header)
myport.write(tosend)
myport.close()
Comments