def run4def(b: myRobot): b.resetMotors() b.gyroReset() # b.playSound("./mario.sh&") b.elore(2.8, 35) b.balra(70, speed=8, prec=2, log=False) b.elore(1.5, 20, end=True) b.hatra(0.05, 10, end=True) # b.hatra(0.1, 10, end=True) b.egyszerre(-100, 2) b.egyszerre(100, 1) b.hatra(0.2, 10, end=True) # b.egyszerre(-60, 8) # b.egyszerre(100, 4) b.jobbra(45, speed=4, prec=1) b.justGo(10, 1) # b.elore(1, 10, 3, absWay=15) b.fullStop(True) # while True: print(b.gs.value()) # b.elore(0.5, 3, absWay=33) # sleep(2) # b.hatra(0.1, 5, end=True) # b.elore(0.3, 20, absWay=20) b.egyszerre(-50, 2) # b.egyszerre(50, 4) b.hatra(1.5, 40) b.justTurn(20, 0.4) b.hatra(3, 40) b.fullStop() pass
def run5def(b: myRobot): b.elore(4, 60) for i in range(5): b.m1.reset() b.m2.reset() b.hatra(0.1) b.elore(0.6) b.hatra(0.2, 30, absWay=0) b.fullStop() b.balra(45, prec=2, log=False) b.fullStop() b.resetMotors() b.elore(0.2, 10) b.balra(95, prec=2, log=False) # b.jobbra(90, 5, prec=1, log=False) b.fullStop() b.elore(0.5, 25, absWay=90, end=True) b.modulok(0, 0, 1, 100) b.elore(2.2, 40, absWay=90, end=True) b.modulok(1, -100, 0, 0) b.hatra(0.5, 20) b.balra(135, speed=5, prec=3) b.elore(1.8, 30, absWay=135, end=True) # while True: b.modulok(0, 0, 0.5, -100) sleep(1) while True: b.modulok(0, 0, 0.5, 100) b.mt.on(20, -20) b.modulok(0, 0, 0.5, -100) b.playSound("./anthem.sh") pass
def run3def(b: myRobot): b.elore(0.9, 30) b.jobbra(-60, 15) b.fullStop(True) sleep(0.5) b.resetMotors() b.elore(1, 100) b.fullStop(True) pass