| Description |
One of the easiest micro controllers to program is the basic stamp range. For this reason I have chosen the BS2p stamp to demonstrate how easy it is to communicate with the HexEngine via the serial control port.
This programme demonstrates HexEngine locomotion control with a one way serial link from the BS2p to the HexEngine. To do this we are using a PS2 style dual shock controller. This code has been successfully tested up to 115200 baud, using a Joytech PS2 clone controller. |
| |
| Equipment Used |
- MSR-H01 Hexapod
- p.Brain-SMB + HexEngine
- BS2p24 + Carrier Board
- PS2 Gamepad Extension Cable
- Joytech PS2 Dualshock Gamepad Clone
|
| |
| HexEngine Configuration |
| CN18 Jumpers Off |
Terminal port = RS232 (UART2) , Control port = TTL (UART1). |
| CBR=4 |
Control baud rate = 19200 |
| PIP=0 |
PIP Packet mode = 0 |
| TXD=3 |
Transmission delay = 3 |
| |
|
|
| |
| PS2 Gamepad Functions |
| PS2 Button |
Hexapod Function |
| START |
Power Up |
| CROSS |
Power Down |
| L THUMB FOR |
Walk Forward |
| L THUMB BACK |
Walk backwards |
| L THUMB LEFT |
Turn Left |
| L THUMB RIGHT |
Turn Right |
| SQUARE |
Crab Left |
| CIRCLE |
Crab Right |
| TRIANGLE |
Reset legs |
| RIGHT STICK PRESS |
Gait Up (Moves up through the 4 gaits) |
| LEFT STICK PRESS |
Gait Down (Moves down through the 4 gaits) |
| WHILE HOLDING R2 |
|
| RIGHT STICK |
Body Rotate X & Z |
| RIGHT STICK + R1 |
Body Rotate X & Y |
| LEFT STICK |
Body Translate X & Y |
| LEFT STICK + R1 |
Body Translate X & Z |
| WHILE HOLDING L2 |
|
| RIGHT STICK |
Proportional Walk Forward/Backward & Turn |
| LEFT STICK |
Proportional Crab |
| |
|
|
| |
| Connection |
Only 2 wires are necessary for communication with the BS2p, which can be found on the p.Brain-SMB connector CN17.
Pin 2 = U1RX
Pin 6 = GROUND
U1RX needs to be connected to the BS2p SER_OUT pin and GROUND to the BS2P ground. IF you are using the 5V regulator ON the p.Brain-SMB, You CAN also take a third wire from PIN 9 ON CN17 TO supply the 5V power to the BS2p
| p.brain-SMB CN17 |
Description |
BS2p |
| Pin 2 |
Data |
Pin 5 (Can be user configured ) |
| Pin 6 |
Ground |
Pin 4 |
| Pin 9 |
5 Volts ( Optional ) |
Pin 21 |
|
| |
| BS2p Code |
|
| |
| Useful Links & Documents |
|
| |