27.10.2014 Views

Basic Stamp 2 Robot Programming - ISL

Basic Stamp 2 Robot Programming - ISL

Basic Stamp 2 Robot Programming - ISL

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

6-34 Chapter Six<br />

Bread<br />

Board<br />

Vss<br />

P1<br />

P3<br />

P5<br />

P7<br />

P9<br />

P11<br />

P13<br />

P15<br />

Vin<br />

AppMod<br />

Vdd<br />

Vdd<br />

Vin<br />

Vss<br />

Vss<br />

P0<br />

P1<br />

P2<br />

P3<br />

P4<br />

P5<br />

P6<br />

P7<br />

Vss<br />

P0<br />

P2<br />

P4<br />

P6<br />

P8<br />

P10<br />

P12<br />

P14<br />

Vdd<br />

470<br />

470<br />

L05<br />

0.1 uF<br />

10 uF +<br />

Vdd<br />

Vdd<br />

Vin<br />

Vss<br />

Vss<br />

P15<br />

P14<br />

P13<br />

P12<br />

P11<br />

P10<br />

P9<br />

P8<br />

Notch in<br />

LED<br />

Display<br />

Parallax Inc<br />

Figure 6-21 Parallax breadboard AppMod with<br />

“Cylon Eye” application.<br />

470-ohm, 1/4-watt resistor<br />

10 µF electrolytic capacitor<br />

0.1 µF capacitor (any type)<br />

Parallax “Breadboard” AppMod board<br />

22-gauge connecting wire<br />

Once you have the parts, you can wire them into the Breadboard AppMod using<br />

the diagram shown in Figure 6-21. While it is not very hard to wire, I found that it<br />

took me a bit of time to plan it out correctly. I suggest that when you are wiring the<br />

10-LED bargraph display to the BS2 you start with bit “P7” and work your way back<br />

to “P0.” This should give you a bit more space to put in the wiring.<br />

To test out the application you can use the code below. It is found in the<br />

C:\tabrobotkit\Cylon Eye<br />

subdirectory of your PC’s hard drive. When you first program the robot, you might<br />

want to take out the commented code that “Stops the <strong>Robot</strong> from Running.” This<br />

way you will be able to test out the application code without having to use the remote<br />

control to stop the robot when it is on your workbench.<br />

‘ Cylon Eye - Run “Scanning” Eye Across LEDs<br />

‘ Connected to LEDS connected to P0 to P9<br />

‘ of the BS2<br />

‘<br />

‘ Myke Predko<br />

‘<br />

‘ Copyright (C) 2001 McGraw-Hill<br />

‘<br />

‘ { $STAMP BS2 }

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!