You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#################################
from lib.mBot import *
def buttonHandling(state):
print "button state: ", state
if name == 'main':
bot = mBot()
bot.startWithSerial("/dev/ttyUSB0")
while(1):
try:
bot.requestButtonOnBoard(1,buttonHandling)
except Exception,ex:
print str(ex)
sleep(0.2)
############################
it gives result:
button state: 1023.0
button state: 1023.0
button state: 1023.0
button state: 1023.0
'callback_128'
Attempting to use a port that is not open
Attempting to use a port that is not open
Attempting to use a port that is not open
Attempting to use a port that is not open
Attempting to use a port that is not open_
The text was updated successfully, but these errors were encountered:
python 2.7.13
Raspberry Pi ver 3 B+
#################################
from lib.mBot import *
def buttonHandling(state):
print "button state: ", state
if name == 'main':
bot = mBot()
bot.startWithSerial("/dev/ttyUSB0")
while(1):
try:
bot.requestButtonOnBoard(1,buttonHandling)
except Exception,ex:
print str(ex)
sleep(0.2)
############################
it gives result:
button state: 1023.0
button state: 1023.0
button state: 1023.0
button state: 1023.0
'callback_128'
Attempting to use a port that is not open
Attempting to use a port that is not open
Attempting to use a port that is not open
Attempting to use a port that is not open
Attempting to use a port that is not open_
The text was updated successfully, but these errors were encountered: