In [1]:
from serial import Serial
from Servo import Servo
from IPython.html.widgets import interact
Initialization
In [2]:
sp = Serial("/dev/ttyUSB0", 19200)
a = Servo(sp, dir = 'a')
Interactive widget for moving the servo
In [3]:
w1 = interact(a.set_pos, pos = (-90, 90))
In [ ]: