Is there some documentation for Processing.py's Serial library?
I've been able to guess some of the syntax from the Java Serial library doc. Here's what I have so far:
add_library('serial')
def setup():
#setup the serial port
print Serial.list()
portIndex = 4
LF = 10
print " Connecting to ", Serial.list()[portIndex]
myPort = Serial(Serial.list()[portIndex], 9600)
myPort.bufferUntil(LF)
def draw():
pass
def serialEvent(evt):
inString = evt.readString()
print inString
I get the following error:
processing.app.SketchException: TypeError: processing.serial.Serial(): 1st arg can't be coerced to processing.core.PApplet
The Java syntax for creating a Serial instance has "this" as the first argument which I assume refers to a Sketch (PApplet) object. How do I reference that in processing.py?