Exemple #1
0
def run2def(b: myRobot):
    b.elore(1.8, 40, absWay=0)
    b.modulok(1.5, 100, 0, 0)
    b.elore(0.2, 40, absWay=-2)
    sleep(1)
    b.hatra(4, 50, absWay=-15)
    # b.balra(50, 50)
    # b.hatra(2, 50)
    # b.balra(100, 50)
    # b.justGo(10, 0.5)
    # b.balra(60, speed=40, prec=5)
    pass
Exemple #2
0
def run3def(b: myRobot):
  b.elore(1.3, 40)
  b.balra(45, prec=2)
  b.elore(1.15, 40)
  b.balra(130, prec=3, log=False)
  b.elore(2, 30, absWay=130)
  # b.modulok(1, 100, 0, 0)
  b.elore(1, 20, absWay=130, end=True)
  b.modulok(1, -100, 0, 0)
  b.hatra(1, 30)
  b.balra(180)
  b.elore(4)
  b.fullStop(True)
  pass
Exemple #3
0
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
Exemple #4
0
def run6def(b: myRobot):
    b.elore(2, 50, 1.5, absWay=6)
    b.elore(1, 30)
    b.fullStop()
    b.sleep(1)  # Uncheck if necessary
    b.hatra(0.5, 20)
    b.elore(1, 20, end=True)
    b.modulok(1, 30, 0, 0)
    b.hatra(2, 50)
    pass
Exemple #5
0
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
Exemple #6
0
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
Exemple #7
0
def test3def(b: myRobot):
    b.modulok(1, 100, 0, 0)
Exemple #8
0
def run1def(b: myRobot):
    # b.elore()
    # b.hatra()
    # b.jobbra()
    # b.balra()
    b.elore(4.9, 80, 3, end=False, absWay=2)
    b.elore(0.8, 10, 3, end=True, absWay=0)
    # b.justGo(20, 0.5)
    # b.elore(0.2, 20, 5, end=True)
    # b.hatra(1, 30, 5, end=True)
    # b.modulok(0.5, 30, 0, 0)
    # b.elore(4, 45, 3, end=True, absWay=0)
    b.modulok(4, 100, 0, 0)
    b.hatra(0.5, 15, 2, 0)
    b.balra(20, speed=8, prec=2)

    b.elore(1.0, 20, absWay=18, end=True)
    b.modulok(0, 0, 1, 100)
    b.hatra(0.2, 5, end=True)
    b.jobbra(6, 10)
    b.hatra(0.5, 15, end=True)
    b.balra(25, 20)
    b.fullStop()
    b.modulok(0, 0, 1, -100)

    b.hatra(0.8, 20)
    b.jobbra(0, 10, prec=3)
    b.hatra(6, 75, absWay=0)
    # b.jobbra(-30)
    # b.hatra(4, 80)
    # b.elore(1.5, 15, end=True)
    # b.modulok(0, 0, 1, 100)
    # b.hatra(0.4, 20, end=True)
    # b.m1.on_for_seconds(10, 1, block=False)
    # b.m2.on_for_seconds(-100, 1)
    # b.modulok(0, 0, 1, -100)
    b.fullStop()
    pass
Exemple #9
0
def test2def(b: myRobot):
  b.egyszerre(-100, 10)