[spearmint] / control.py Repository:
ViewVC logotype

View of /control.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (download) (as text) (annotate)
Wed Jul 26 13:18:12 2006 UTC (3 years, 3 months ago) by synack
File size: 404 byte(s)
Initial import
import serial, socket

pic = serial.Serial(2)	# gumstix uses /dev/ttyS2 for ST-UART
print 'Connected to ' + pic.portstr
pic.write('OK')

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
sock.setsockopt(socket.SO_BROADCAST)

while pic.isOpen():
	line = pic.read(10)
		# read a telemetry line in the format A000:R000
	sock.sendto(line, None, '192.168.1.255')
		# relay the line to the UDP socket

synack at csh.rit.edu
ViewVC Help
Powered by ViewVC 1.0.0