In [1]:
from Myro import *
from Graphics import *
makeRobot("Arduino", "/dev/tty.usbmodem1411")
In [4]:
def ledOn():
    digitalWrite(13, 1)
ledOn()
In [3]:
def ledOff():
    digitalWrite(13, 0)
ledOff()
In [5]:
cam = calico.makeCameraWidget()
calico.display(cam)
In [6]:
calico.display(Picture(cam.imageuri))
In [7]:
analogRead(0)
Out[7]:
767
In [8]:
from Processing import *
window(800, 160)
background(0)
noStroke()
for x in range(800):
    y = analogRead(2)/5
    fill(255, 0, 196)
    ellipse(x, y, 3, 3)
    delay(10)
    calico.animate(get())
Running script aborted!
In [17]:
window(800, 160)
background(0)
noStroke()
for x in range(800):
    y = analogRead(2)/5
    if y > 100:
        ledOn()
    else:
        ledOff()
    fill(255, 0, 196)
    ellipse(x, y, 3, 3)
    delay(10)
    calico.animate(get())
Running script aborted!
In [ ]: