Getting "ServoRun2-0" to work
Cyril Wichers
✭✭✭
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:
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<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>
0
Comments
Those not familiar with using with Python's "IDLE", here are a few links with a little background...
https://en.wikipedia.org/wiki/IDLE
http://web.mit.edu/6.s189/www/handouts/GettingStarted.html
http://www.annedawson.net/Python_Editor_IDLE.htm
Or, go here to search for even more...
https://www.google.com/search?q=Python+IDLE&oq=Python+IDLE&aqs=chrome..69i57j69i60j0l4.5636j0j4&sourceid=chrome&ie=UTF-8