diff options
author | Walter Bender <walter@sugarlabs.org> | 2013-07-27 22:38:22 (GMT) |
---|---|---|
committer | Walter Bender <walter@sugarlabs.org> | 2013-07-27 22:38:22 (GMT) |
commit | a308a5425f6f7bed7fc15ba43d9bf3f1894083fa (patch) | |
tree | bd6a6c37615a6a69a8d391b0dc4e796c82638dd0 /pysamples/serial.py | |
parent | bf2d9ffa0052fbe2a025d871b9b3c5e91e9c7ff2 (diff) |
remove extra stuffv187
Diffstat (limited to 'pysamples/serial.py')
-rw-r--r-- | pysamples/serial.py | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/pysamples/serial.py b/pysamples/serial.py deleted file mode 100644 index 84772ab..0000000 --- a/pysamples/serial.py +++ /dev/null @@ -1,21 +0,0 @@ -#Copyright (c) 2010-11, Walter Bender, Tony Forster -# -# This Python block writes serial output to a USB port and pushes -# serial input to the heap. -# -# To use this block: -# (1) import this file into a Python Block; -# (2) pass text strings as an argument -# (3) use a Pop Block to retrieve any strings input from serial device. - - -def myblock(tw, x): # 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 - st = ser.read(1000) # read up to 1000 bytes - tw.lc.heap.append(st) # append to heap - ser.close() |