Setting
up IDLE
1) follow the download instructions
for PySerial, Python 2.5.4, and Pygame
2) open IDLE, this will bring up
a window that says Python Shell
3) the >>> is the IDLE prompt
where python can be typed
Set up
the PYTHONPATH
Note: This only needs to happen once
and then the path will be set to the folder location
For
Windows:
1) create a
new environment
variable
a) on Windows 7, open the start menu and type in the search
box: environment
b)
click on "edit environment variables for your account" which will
bring up a window
c) under the list of User variables select "New..." which will
bring up another window with two blanks, one for Variable name
and one for Variable
value.
d)
for Variable name type PYTHONPATH, for Variable value put the entire
path location of the folder containing
robot.py
starting with C:\
For
Mac:
1) open a
text editor (TextEdit)
2) in the Format
menu, select Make Plain Text
3) in
the text editor type the entire path location of the folder containing
robot.py
4) save the text file as
engi128.pth in the /Library/Python/2.5/ folder
How to change the keys to cycle
through past entered commands
Note: if you do not change
the keys to cycle through past entered commands, the default is alt + P and alt
+ N for Windows and
ctrl +
P and ctrl + N for Mac.
For
Windows:
1)
in the menu bar at the top of the IDLE window, select the Options drop
down menu.
2) select "Configure IDLE..." which
will bring up another window
3) select Keys
from the menu at the top of the window
4)
in the list of "Action -Key(s)" select
"history-next"
5) once "history-next" is
highlighted select the button "Get New Keys for Selection" which brings up a new
window
6) scroll down to the bottom of the
list of possible keys and select "Down Arrow" and then select "OK" You will be
asked to save
the key set. The name is not important. It will be the name of this new
setting so you can toggle between it or the default
setting.
7) in the list of "Action -Key(s)"
select "history-previous"
8) once
"history-previous" is highlighted select the button "Get New Keys for Selection"
which brings up a new window
9) scroll down to
the bottom of the list of possible keys and select "Up Arrow" and then select
"OK." Now instead of alt + P
and
alt + N, the up
and down arrows will cycle through the past entered
commands
For
Mac:
1) in IDLE's
menu , select the Python drop down menu.
2) select "Preferences..." which will bring up another
window
3) select Keys from the menu at the top
of the window
4) in the list of "Action
-Key(s)" select "history-next"
5) once
"history-next" is highlighted select the button "Get New Keys for Selection"
which brings up a new window
6) scroll down to
the bottom of the list of possible keys and select "Down Arrow" and then select
"OK" You will be asked to
save
the key set.
The name is not important. It will be the name of this new setting so you can
toggle between it or the default setting.
7)
in the list of "Action -Key(s)" select
"history-previous"
8) once "history-previous"
is highlighted select the button "Get New Keys for Selection" which brings up a
new window
9) scroll down to the bottom of the
list of possible keys and select "Up Arrow" and then select "OK." Now instead
of ctrl + P
and
ctrl + N, the
up and down arrows will cycle through the past entered
commands
How to find the
serial port for your robot
Note:
It'll be different for each computer you use your robot with. Also, if it's
unclear what the port is, look at what is
listed
when your robot is turned off and then compare that to when the robot
is turned on.
For
Windows:
1) open the device manager
a) on Windows 7, open the start menu
and type in the search box: device
manager
b) click
on device manager
2) plug in your robot (with
the robot turned on)
3) click on the arrow
next to Ports to drop down a list of ports
4) look at the USB Serial Port. In paranthesis there will be COM and a
number --> example: (COM5). "com5" would be your
robot's
serial port
for this computer.
For
Mac:
1) open a
terminal
2) plug in your robot (with the robot
turned on)
3) type ls /dev in the
terminal
4) find
tty.usbserial-"something" --> example: tty.usbserial-A700eJSe.
"/dev/tty.usbserial-A700eJSe" would be your
robot's
serial
port for this computer.
Note: having to type
robot.connect("serial port") and robot.program("serial port", "pythonfile.py")
will happen
frequently
so
to avoid having to type the serial port over and over, use the keys to
scroll through past commands. Even if the
command is not the
exact same, you can just edit the past command and then run
it.