Here are example two programs which fail
The first one :
import cyberpi
import time
cyberpi.pocket.motor_stop('m1')
while True:
if cyberpi.controller.is_press("a"):
cyberpi.pocket.motor_set(100,'m1')
time.sleep(0.3)
if cyberpi.controller.is_press('b'):
cyberpi.pocket.motor_stop('m1')
time.sleep(0.3)
it doesn’t show anything to the console, doesn’t react to the keys …
In case of second attempt :
# generated by mBlock5 for CyberPi
# codes make you happy
import event, time, cyberpi
@event.is_press('a')
def is_btn_press():
# DO SOMETHING
cyberpi.pocket.motor_set(100,'m1')
time.sleep(3)
cyberpi.pocket.motor_stop('m1')
I get :
>>
Traceback ( most recent call last):
File “main” ,
line 11, in
<module>
<<
and Line 11 refrences the last line of the program above…
I am on windows 8 and use mlink2 with Chrome’s web browser and makeblock application in it. Wish I could at least see error logs of those programs …