From 6acdbc3db543f2692ee336a99722f5ab0b46c77e Mon Sep 17 00:00:00 2001 From: Walter Bender Date: Wed, 13 Nov 2013 22:42:18 +0000 Subject: convert to new primitive type --- (limited to 'pysamples/serial.py') diff --git a/pysamples/serial.py b/pysamples/serial.py index 84772ab..d15011c 100644 --- a/pysamples/serial.py +++ b/pysamples/serial.py @@ -9,13 +9,13 @@ # (3) use a Pop Block to retrieve any strings input from serial device. -def myblock(tw, x): # x is the string to transmit +def myblock(tw, args): # x is the string to transmit import serial # you may need to install this library # serial device on USB, 9600 baud ser = serial.Serial('/dev/ttyUSB0', 9600, timeout=1) - ser.write(str(x)) # send string x + ser.write(str(args[0])) # send string x st = ser.read(1000) # read up to 1000 bytes tw.lc.heap.append(st) # append to heap ser.close() -- cgit v0.9.1