background image

Copyright © Parallax Inc.  

Penguin Robot (#27313-27316) 

v1.4  2/16/2010  Page 21 of 23 

' Parallax Penguin Robot 
' Penguin-IRTest.bpx 
 
' {$STAMP BS2px} 
' {$PBASIC 2.5} 
 
REmitter       CON     2 
LEmitter       CON     3 
IrInput        VAR     IN4 
LeftIr         VAR     Bit 
RightIr        VAR     Bit 
 
DEBUG CLS                                    ' Prepare debug screen 
DEBUG "Infrared sensor status:", CR, 
      "Left:", CRSRXY, 15, 1,"Right:" 
DO 
  GOSUB ReadIr                               ' Update debug screen with 
  DEBUG CRSRXY, 6, 1, DEC LeftIr             ' status of IR sensors 
  DEBUG CRSRXY, 22, 1, DEC RightIr 
  PAUSE 150 
LOOP 
 
ReadIr: 
  FREQOUT LEmitter,1,6300                    ' Modulate emitters at 38KHz 
  LeftIr = ~IrInput                          ' and check for reflections 
  FREQOUT REmitter,1,6300 
  RightIr = ~IrInput 
RETURN 

 

' Parallax Penguin Robot 
' Penguin-7SegmentLEDTest-v1.3.bpx 
 
' {$STAMP BS2px} 
' {$PBASIC 2.5} 
 
' Rev A. boards use the OUTC port to control a 74LS47 BCD to 7-segment decoder 
LEDDisplay     VAR     OUTC                  ' The LED display mirrors OUTC 
 
' Rev. B boards use a 74HC595 shift register to individually set and clear LEDs 
LED_CLK        PIN     8                     ' LED's shift register clock pin 
LED_DATA       PIN     9                     ' LED's shift register data pin 
LED_LATCH      PIN     10                    ' LED's shift register latch pin 
 
ShiftData      VAR     Byte 
Index          VAR     Nib 
 
DIRC = %1111                                 ' Set all used I/O pins as outputs 
 
DO 
  FOR Index = 0 TO 9                         ' Loop numbers 0-9 on the display 
    ' For Rev. B PCBs, send data to the shift register 
    READ Index, ShiftData 
    SHIFTOUT LED_DATA, LED_CLK, LSBFIRST, [ShiftData] 
    LED_LATCH = 0                            ' Then create a falling edge 
    LED_LATCH = 1                            ' To latch the data to the LEDs 
    ' For Rev. A PCBs, set the 74LS47 in parallel through OUTC 
    LEDDisplay = Index 
    PAUSE 750                                ' Wait 3/4 of a second 
  NEXT 
LOOP 
 
' Font for the Rev. B display 
DATA $06, $CF, $A2, $C2, $4B, $52, $13 ,$CE, $02, $42 

Summary of Contents for Penguin

Page 1: ...ed together for this robot to walk This basic biped design functions best in the Penguin s small scale The Penguin mechanics have a close tolerance fit and are designed to provide precise electronic c...

Page 2: ...The Penguin s electronics are fully assembled and wired to an assortment of I O devices Additionally it has a fairly complex programming process which is more difficult to understand than a two wheele...

Page 3: ...5 2 56 threaded rod 2 5 long 2 710 00013 4 40 1 8 long 0 149 diameter stainless steel shoulder screw 4 710 00010 4 40 1 8 long 1 8 diameter stainless steel shoulder screw 4 710 00011 4 40 1 4 button s...

Page 4: ...Copyright Parallax Inc Penguin Robot 27313 27316 v1 4 2 16 2010 Page 4 of 23 1 5 BODY KIT MECHANICAL DRAWINGS...

Page 5: ...process includes several steps where you will be exposed to danger You will be using a sharp drill bit to enlarge a tiny hole and tiny pieces may fly You will be pressing ball joints together where a...

Page 6: ...ted Orientation may differ from picture shown c Plug two servos into the bottom of the power pack being careful to orient them correctly From the perspective of this photo the servo s white leads are...

Page 7: ...on the stride servo Locate the small black plastic stride linkage with two ball shaped ends This part has changed the style shown on the left is included in your kit The previous style is shown in al...

Page 8: ...est part of the ankle faces forward Shoulder screws have a 1 8 diameter smooth stainless steel surface upon which the legs will rock back and forth To install the leg assemblies on the Penguin use the...

Page 9: ...ach foot has an additional 2 56 threaded hole where the Penguin s ball joints mount for the threaded rod which connects to the tilt servo the ski poles These threaded holes denote the front of the foo...

Page 10: ...quent step Open the package and thread the 2 56 ball link post into the front of each foot You can tighten them using a 3 16 socket or small wrench Be careful not to scratch the feet as you tighten th...

Page 11: ...des an assortment of servo horns We ll use the widest servo horn in this step If you make a mistake it s okay because there s a second one in the other servo package Put on your safety goggles Place t...

Page 12: ...16 ball links on the servo horn Tighten carefully but don t deform the plastic Step 11 Attach the servo horn to the tilt servo Press the assembled servo horn onto the tilt servo positioning it cross w...

Page 13: ...ocket Future adjustments can be made quite easily by disconnecting the ball link socket from the feet only To disconnect them use a small screwdriver as a lever against the foot Cover the foot with a...

Page 14: ...board to the Penguin body The Penguin s top board contains the BASIC Stamp 2px24 circuitry It is mounted on the top of the Penguin using 2 2 56 1 4 button socket cap stainless steel screws and the 0...

Page 15: ...power pack board is installed using 4 2 56 long flathead screws and the 0 050 hex key When you mount this board be sure that the servo wires are not preventing it from properly seating into position P...

Page 16: ...ll be oriented in the same direction refer to the pictorial molded into the bottom of the battery holder s plastic surface Coil up the servo wires behind the robot It s also possible to hide them in t...

Page 17: ...to knife to remove any plastic burrs inside the plastic socket b Add a drop of oil into the socket c Reassemble the ball links and check for friction Legs move too much from left to right Pressing the...

Page 18: ...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 Ent...

Page 19: ...space is required Separate versions of the following programs have been created to allow for either more available resources or a more accurate compass Original Code Code Incorporating a Calibrated C...

Page 20: ...0 Freq Play the frequency Freq Freq Scale lower frequency by 1 octave NEXT Parallax Penguin Robot Penguin PhotoresistorTest bpx STAMP BS2px PBASIC 2 5 RLDRPin PIN 0 LLDRPin PIN 1 LeftLDR VAR Word Righ...

Page 21: ...2px PBASIC 2 5 Rev A boards use the OUTC port to control a 74LS47 BCD to 7 segment decoder LEDDisplay VAR OUTC The LED display mirrors OUTC Rev B boards use a 74HC595 shift register to individually se...

Page 22: ...ReadCompass DEBUG CRSRXY 9 0 DEC Heading PAUSE 150 LOOP ReadCompass Compass module subroutine HIGH Enable Send reset command to HM55B LOW Enable SHIFTOUT Compass Clock MSBFIRST Reset 4 HIGH Enable HM...

Page 23: ...ave approximately the same capacity as the more expensive ones and they re sold by Parallax at less than half the price of retail outlets Don t be fooled into paying high prices for CR123 batteries If...

Page 24: ......

Reviews: