Esempio n. 1
0
#!/usr/bin/env python3
"""
Author: Paul T
Date: 6/14/2019

"""

import linkbot

robot = linkbot.CLinkbot("ABCD")  # change to your id
radius = 1.75
robot.driveDistance(6, radius)
robot.driveDistance(-8, radius)
robot.driveDistance(2, radius)
Esempio n. 2
0
#!/usr/bin/env python3
import linkbot

robot = linkbot.CLinkbot(
    "ABCD")  # put the serial id of the linkbot in the string
red = 55  # the red intensity from 0 to 255
green = 255  # the green instensity from 0 to 255
blue = 0  # the blue intensity
robot.set_led_color(red, green, blue)  # this will set the color to green
Esempio n. 3
0
]


def play_tone(robot, freq, duration):
    robot.set_buzzer_frequency(freq)
    time.sleep(duration)
    robot.set_buzzer_frequency(0)


def play_score(score, tempo):
    for freq, duration in [(notes[n.upper()], durations[d]) for n, d in score]:
        #print(duration,freq)
        play_tone(robot, freq, duration * tempo)


robot = linkbot.CLinkbot("P3S1")


def loop():
    while 1:
        #   robot.set_led_color(255, 0, 0)  # Change the LED color
        robot.move(720, 0, 720)  # Begin moving each motor 90 degrees
        time.sleep(0.5)
        #robot.move_wait()         # Wait for the motion to complete
    #   robot.set_led_color(0, 255, 0) # Change the LED color


# Define a function for the thread
def move(threadName):
    while 1:
        pass
Esempio n. 4
0
#!/usr/bin/env python3
import linkbot

robot = linkbot.CLinkbot("6J3Q")
robot.move_to(0, 0, 0)
robot.motors[0].move(720, wait=False)
robot.motors[2].move(720, wait=False)
robot.motors[0].move_wait()
robot.motors[2].move_wait()