Skip to content

mBot instance has no attribute 'device' #6

Description

@lukaszrc

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_

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions