예제 #1
0
def main():
    lavender= M.makeColor(164, 131, 196)
    teal= M.makeColor(140, 253, 153)
    cyan= M.makeColor(90, 200, 250)
    pink= M.makeColor(255, 153, 204)

    pic= M.makePicture('phoebe.jpg')
    pixels= M.getPixels(pic)
    for pixel in pixels:
        r= M.getRed(pixel)
        b= M.getBlue(pixel)
        g= M.getGreen(pixel)
        if r<35 and g<35 and b<35:
            M.setColor(pixel, lavender)
        elif r<100 and g<100 and b<100:
            M.setColor(pixel, teal)
        elif g<150 and b<200:
            M.setColor(pixel, pink)
        else:
            M.setColor(pixel, cyan)
    M.show(pic)
예제 #2
0
import Myro
Myro.init()

pic = Myro.takePicture()
Myro.show(pic)

Myro.robot.backward(1, 1)
Myro.robot.forward(1, 1)
Myro.robot.beep(1, 440)
Myro.robot.beep(1, 440, 880)
Myro.robot.forward(.5, 2)
Myro.robot.backward(.5, 2)
print(Myro.robot.get("all"))
print(Myro.robot.getAll())
print(Myro.robot.getBattery())
print(Myro.robot.getBlob())
# print(Myro.robot.getBright())
print(Myro.robot.getConfig())
print(Myro.robot.getData())
print(Myro.robot.getIR())
print(Myro.robot.getIRMessage())
print(Myro.robot.getInfo())
print(Myro.robot.getLight())
print(Myro.robot.getLine())
print(Myro.robot.getName())
# print(Myro.robot.getObstacle())
print(Myro.robot.getPassword())
print(Myro.robot.getStall())
Myro.robot.motors(.5, .5)
Myro.robot.move(1, 1)
Myro.robot.move(-1, -1)