Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mBot instance has no attribute 'device' #6

Open
lukaszrc opened this issue Jul 28, 2018 · 0 comments
Open

mBot instance has no attribute 'device' #6

lukaszrc opened this issue Jul 28, 2018 · 0 comments

Comments

@lukaszrc
Copy link

lukaszrc commented Jul 28, 2018

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_

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant