Copyright © Parallax Inc.
Penguin Robot (#27313-27316)
v1.4 2/16/2010 Page 18 of 23
3.0 PROGRAMMING THE PENGUIN
3.1. PROGRAMMING CONCEPT
Programming the Penguin to walk is a matter of shifting its center of gravity from side to side with the tilt
servo, coordinated with moving the legs forward and backward with the stride servo. The BS2px24’s high
speed and expanded memory and RAM are useful for storing motion sequences and for performing the
computations needed in sensor-based autonomous navigation.
Close the Debug Terminal before downloading a new program, disconnecting the USB cable,
or switching off the power to your tethered Penguin!
If you fail to close the Debug Terminal
before any of these actions, the port may hang up and the BASIC Stamp Editor may freeze when you
next try to program your Penguin. If this happens, close the Editor with the Task Manager. Be sure to
download the latest version of the BASIC Stamp Editor from www.parallax.com.
3.2. SERVO CALIBRATION
The Penguins servos must be calibrated before the Penguin can walk. This is a crucial step and the
Penguin will not walk without it.
1) Run
Penguin-ServoCalibration.bpx.
2) Click in the white Transmit area at the top of the Debug Terminal.
3) Press
Enter
to enable the servos.
4) Press
+
and
−
to adjust the tilt servo until the Penguin can stand level.
5) Press the space bar to switch to the stride servo.
6) Press
+
and
−
to adjust the stride servo until the Penguin’s feet are in line with each other.
7) Press
S
to save the new settings.
8) Listen for the long beep to ensure that the settings were saved.
Tip: Pressing 1 through 5 changes the coarseness of the adjustments
3.3. PENGUIN’S BASIC STAMP 2PX24 PINOUT
I/O Pin
Description
Direction
P0
Photoresistor – right
Output
P1
Photoresistor – left
Output
P2
Infrared emitter – right
Output
P3
Infrared emitter – left
Output
P4 Infrared
receiver
Input
P5
Front I/O expansion port
Input/Output
P6 Servo
stride
Output
P7 Servo
tilt
Output
P8
7-segment LED clock
Output
P9
7-segment LED data
Output
P10
7-segment LED latch
Output
P11
Rear I/O expansion port
Input/Output
P12 Speaker
Output
P13
Hitachi HM55B Compass – CLK (clock)
Output
P14
Hitachi HM55B Compass – CS (chip select)
Output
P15
Hitachi HM55B Compass – DIN/DOUT (data in/out) Input/Output
Содержание Penguin
Страница 24: ......