コード例 #1
0
ファイル: d_powertrain.py プロジェクト: tmdorny/School-Work
    print("calling reverse(80)")
    pwr.reverse(100)
    time.sleep(t)
    pwr.stop()

    # pivot clockwise and counterclockwise
    print("calling pivot(50)")
    pwr.pivot(80)
    time.sleep(t)
    print("calling pivot(50, clockwise=True)")
    pwr.pivot(80, True)
    time.sleep(t)
    pwr.stop()

    # turn wide
    print("calling turn_left(50, 20)")
    pwr.turn_left(100, 80)
    time.sleep(t)
    pwr.stop()

    # turn tight
    print("calling turn_right(80, 80)")
    pwr.turn_right(100, 80)
    time.sleep(t)
    pwr.stop()

    print("done")
except KeyboardInterrupt:
    pwr.stop()
    GPIO.cleanup()
コード例 #2
0
ファイル: d_powertrain.py プロジェクト: kb0099/picar
print("calling forward(80)")
pwr.forward(80)
time.sleep(t)
print("calling reverse(80)")
pwr.reverse(80)
time.sleep(t)
pwr.stop()

# pivot clockwise and counterclockwise
print("calling pivot(50)")
pwr.pivot(50)
time.sleep(t)
print("calling pivot(50, clockwise=True)")
pwr.pivot(50, True)
time.sleep(t)
pwr.stop()

# turn wide
print("calling turn_left(50, 20)")
pwr.turn_left(50, 20)
time.sleep(t)
pwr.stop()

# turn tight
print("calling turn_left(80, 80)")
pwr.turn_left(80, 80)
time.sleep(t)
pwr.stop()

print("done")