I have determined that my scooter routine is hanging up on trying to clean out the serial buffer that used to work with MRL .99.
Where can I find out what the new serial routine can accept and pass back and forth, command line options.
like how many characters in buffer, empty buffer, stop serial?
thanks
harland
The new serial (1.0.118) can
The new serial (1.0.118) can do synchronous & asynchronous reads, it can also clear and filter, it can even be enabled with timeouts on synchronous reads. The data being displayed to the view is helpful too - http://myrobotlab.org/service/Serial
Do you have the script which your currently using in you script library ?
If not can you post it and I'll help getting what you need out of the new service.
my scooter script is posted
my scooter script is posted scooter.xbox.v27.py under harland
when I sent the "no worky" last week I posted it.
def clearbuffer():
crap = 0
crap = serial.available()
print("cbuf " + str(crap))
#would like to clean out serial buffer
for i in range(1,crap):
junk = serial.read()
# print("junk=" + str(junk))
It looks like serial.available is always showing 0 bytes with new code.
thanks
Short Answer .. don't read ..
Short Answer .. don't read .. use the .clear method !
serial.clear()
read will block unless you set it up to timeout - clear() does not block
Some other things I noticed:
Ran your script with 2 virtual ports
I can see the Eddie board recieves this initially
I noticed in you no worky - you have a "java.io.IOException: gnu.io.PortInUseException: Unknown Application - for COM3"
Zombie problem perhaps ?