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:
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<br>iFile = input ('Input file name: ')<br>oFile = input ('Output file name: ')<br>maxServo = 0<br>maxServo = int(maxServo)<br>print('\nPlease enter the appropriate number for your Pololu board')<br>print('\n1 for Pololu 6 servos')<br>print('\n2 for Pololu 12 servos')<br>print('\n3 for Pololu 18 servos')<br>print('\n4 for Pololu 24 servos')<br>choice = input ('\ninput: ')<br>choice = int(choice)<br>print (choice)<br>while (int(choice) < 1 or int(choice) > 4):<br>    print ('\nPlease enter a value ranging from 1-4')<br>    print ('\nAgain the choices are as follows')<br>    print('\n1 for Pololu 6 servos')<br>    print('\n2 for Pololu 12 servos')<br>    print('\n3 for Pololu 18 servos')<br>    print('\n4 for Pololu 24 servos')<br>    choice = input('\ninput:')<br>    choice = int(choice)<br>if (choice == 1):<br>    maxServo = 6<br>elif(choice == 2):<br>    maxServo = 12<br>elif(choice == 3):<br>    maxServo = 18<br>elif(choice == 4):<br>    maxServo = 24<br><br>print('\nmax servos : ' + str(maxServo))<br>ServoIntegrated.runServoPrint('w', iFile+'.txt', oFile+'output.txt', 41, maxServo)<br>#ServoIntegrated.runMan()<br><br>


Sign In or Register to comment.