Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Getting "ServoRun2-0" to work

Cyril WichersCyril Wichers ✭✭✭
edited August 2017 in Animation for Animatronics
Because some of us had problems getting "ServoRun2-0" to work, here's the solution that Arlen Feldman came up with at the end of the course.

If you haven't done so already, install the latest version of Python (in my case 3.6.2) It can be found here: https://www.python.org/downloads/
Then, you have to open the script in Python IDLE and edit it. Everywhere it says "raw_input", you have to change it to just "input" and then save it.
When you try to run the script, it should open a command window, like in Craig's course.

The script should look like this:
import ServoIntegrated
iFile = input ('Input file name: ')
oFile = input ('Output file name: ')
maxServo = 0
maxServo = int(maxServo)
print('\nPlease enter the appropriate number for your Pololu board')
print('\n1 for Pololu 6 servos')
print('\n2 for Pololu 12 servos')
print('\n3 for Pololu 18 servos')
print('\n4 for Pololu 24 servos')
choice = input ('\ninput: ')
choice = int(choice)
print (choice)
while (int(choice) < 1 or int(choice) > 4):
print ('\nPlease enter a value ranging from 1-4')
print ('\nAgain the choices are as follows')
print('\n1 for Pololu 6 servos')
print('\n2 for Pololu 12 servos')
print('\n3 for Pololu 18 servos')
print('\n4 for Pololu 24 servos')
choice = input('\ninput:')
choice = int(choice)
if (choice == 1):
maxServo = 6
elif(choice == 2):
maxServo = 12
elif(choice == 3):
maxServo = 18
elif(choice == 4):
maxServo = 24

print('\nmax servos : ' + str(maxServo))
ServoIntegrated.runServoPrint('w', iFile+'.txt', oFile+'output.txt', 41, maxServo)
#ServoIntegrated.runMan()

Comments

Sign In or Register to comment.