Skip to content

Instantly share code, notes, and snippets.

@iandanforth
Created June 22, 2013 02:35
Show Gist options
  • Select an option

  • Save iandanforth/5835609 to your computer and use it in GitHub Desktop.

Select an option

Save iandanforth/5835609 to your computer and use it in GitHub Desktop.
Dynamixel Setup
'''
How to work with the AX1 Sensor
git clone git@github.com:iandanforth/pydynamixel.git
git checkout axs1
python setup.py install
'''
import dynamixel
import time
# Connect to dynamixels
portName = "/dev/tty.usbserial-A501ELE8"
baudRate = 1000000
serial = dynamixel.SerialStream(port = portName, baudrate = baudRate,
timeout = 1)
net = dynamixel.DynamixelNetwork(serial)
## Sensor
sensor = dynamixel.SensorModule(100, net)
while True:
# Get our sensor values and time elapsed
print sensor.left_ir_sensor_value
print sensor.center_ir_sensor_value
print sensor.left_ir_sensor_value
time.sleep(.1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment