Example #1
0
def run():
    md = MotorDriver()

    while True:
        time.sleep(10)
        md.motor_send(1, 10, 'fwd')
        time.sleep(10)
Example #2
0
from motor_driver import MotorDriver
from arm_driver import ArmDriver
from servo_driver import ServoDriver
import time
import random as r

md = MotorDriver()
sd = ServoDriver()
ad = ArmDriver()

while True:
    dist = r.randint(15, 50)
    print("dist is", dist)
    speed = 1
    print("speed is ", speed)
    md.motor_send(speed, dist, 'fwd')
    time.sleep(dist * 0.1)

    func = r.randint(1, 3)

    if func == 1:
        sub_func = r.randint(1, 2)
        if sub_func == 1:
            if ad.state == 'up':
                ad.down()
            else:
                ad.up()
        else:
            ad.pickup()
    elif func == 2:
        sub_func = r.randint(1, 2)
Example #3
0
from motor_driver import MotorDriver

md = MotorDriver()

while True:
    info = input("Enter Speed, Time, Direction:" )
    input_dims = info.split()
    speed = float(input_dims[0])
    dur = float(input_dims[1])
    dir = str(input_dims[2])

    print(speed, dur, dir)

    md.motor_send(speed, dur, dir)
Example #4
0
#!/usr/bin/env python3

from ultrasonic_driver import UltrasonicDriver
from motor_driver import MotorDriver
import time

md = MotorDriver()

time.sleep(15)
for i in range(6):
    print('sending', i)
    md.motor_send(1,100,'fwd')

time.sleep(10)
print('stopping')
md.stop()