Attachments you submit will be routed for moderation. If you have an account, please log in first.

Ticket #1949: Pippy Activity

File Pippy Activity, 337 bytes (added by tonyforster, 6 years ago)

python block code, serial

1def myblock(tw, x): # x is the string to transmit   
2   import serial    # you may need to install this library
3   ser=serial.Serial('/dev/ttyUSB0',9600,timeout=1)
4   # serial device on USB, 9600 baud
5   ser.write(str(x)) #send string x
6 #read up to 1000 bytes
7 #append to heap
8   ser.close()