Created
June 22, 2013 02:35
-
-
Save iandanforth/5835609 to your computer and use it in GitHub Desktop.
Dynamixel Setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| 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