Exemplo n.º 1
0
# import nxt
#
# # brick = nxt.locator.find_one_brick(name = 'Hooper')
# b = nxt.locator.find_one_brick(
#     name="NXT", strict=True,
#     method=nxt.locator.Method(
#         bluetooth=False, fantomusb=True, fantombt=False, usb=False))

from ev3dev.auto import OUTPUT_D, LargeMotor
import time

m = LargeMotor(OUTPUT_D)
print(m)
m.run_forever(speed_sp = 360)
time.sleep(1)
m.stop()
print('Hooray')
Exemplo n.º 2
0
# import nxt
#
# # brick = nxt.locator.find_one_brick(name = 'Hooper')
# b = nxt.locator.find_one_brick(
#     name="NXT", strict=True,
#     method=nxt.locator.Method(
#         bluetooth=False, fantomusb=True, fantombt=False, usb=False))

from ev3dev.auto import OUTPUT_D, LargeMotor
import time

m = LargeMotor(OUTPUT_D)
print(m)
m.run_forever(speed_sp=360)
time.sleep(1)
m.stop()
print('Hooray')
Exemplo n.º 3
0
baseTouch = TouchSensor(INPUT_1)
armTouch = TouchSensor(INPUT_2)
colorSensor = ColorSensor(INPUT_3)
clawMotor = MediumMotor(OUTPUT_A)
armMotor = LargeMotor(OUTPUT_B)
baseMotor = LargeMotor(OUTPUT_C)

# Claw Opening
ev3.Sound.speak("Now opening claw.").wait()
clawMotor.run_forever(speed_sp=100)
time.sleep(.5)
clawMotor.stop()

# Arm Moving to down position
ev3.Sound.speak("Now moving arm down.").wait()
armMotor.run_forever(speed_sp=120)
time.sleep(2.5)
armMotor.stop()

# Claw closing on object to pick up
ev3.Sound.speak("Now closing claw.").wait()
clawMotor.run_forever(speed_sp=-100)
time.sleep(2)

# Arm moving to the up position
ev3.Sound.speak("Now moving arm up.").wait()
armMotor.run_forever(speed_sp=-360)
time.sleep(.85)
armMotor.stop()

# Base moving to center position