+ 8

I am using raspberry pi 3 to build an interface in tkinter. And there is an emergency button connected to Arduino nano. Arduino

I am using raspberry pi 3 to build an interface in tkinter. And there is an emergency button connected to Arduino nano. Arduino Nano sends signal through USB serial port. And I read value in the serial port using periodically calling function. And when user presses the emergency button I wanted to call the function disconnect which is inside of the class where Tkinter is build. elif(read_ser=="emer"): RobotController.disconn(). But the error I get says that the disonn function needs 1 required argument self, if I put self it says 'self' is not defined. If I do like this (RobotController is the class name): x=RobotController() x.disconn() it says that x=RobotController( ) requires 1 information 'master'. If I put 'master' there I got another error

14th May 2019, 9:55 AM
Zhenis Otarbay
Zhenis Otarbay - avatar
2 odpowiedzi
+ 3
hmm can you try: def stop(): x.disconnect()
14th May 2019, 1:46 PM
Thomas Wittek
Thomas Wittek - avatar
+ 1
what is the output of this code? >>>x=4 >>>x*=3 >>>print(x) the answer is 12
15th May 2019, 8:39 AM
zinedine pandor
zinedine pandor - avatar