Wiki source code of AL5 Programming Tutorial - PS2 & BotBoarduino
Last modified by Eric Nantel on 2026/04/06 10:24
Hide last authors
![]() |
27.1 | 1 | {{html wiki="false" clean="false"}} |
| 2 | <style> | ||
| 3 | .asm { font-family: Verdana, Helvetica, sans-serif; font-size: 14px; max-width: 960px; } | ||
| 4 | .asm-step { background: #fff; border: 1px solid #ddd; border-radius: 8px; margin-bottom: 1.5rem; overflow: hidden; } | ||
| 5 | .asm-step-header { background: #F5A800; display: flex; align-items: stretch; justify-content: space-between; } | ||
| 6 | .asm-step-name { padding: 0.6rem 1rem; font-weight: bold; font-size: 15px; color: #2C1A00; } | ||
| 7 | .asm-step-num { background: #1a1a1a; color: white; padding: 0.6rem 1.1rem; font-weight: bold; font-size: 15px; display: flex; align-items: center; white-space: nowrap; } | ||
| 8 | .asm-step-body { display: flex; flex-wrap: wrap; gap: 1.25rem; padding: 1rem; align-items: flex-start; } | ||
| 9 | .asm-step-text { flex: 1 1 250px; font-size: 13px; line-height: 1.6; } | ||
| 10 | .asm-step-figure { flex: 0 1 280px; text-align: center; } | ||
| 11 | .asm-step-figure img { max-width: 100%; height: auto; border: 1px solid #ccc; border-radius: 4px; } | ||
| 12 | .asm-step-figure span { display: block; font-size: 12px; color: #666; margin-top: 0.3rem; } | ||
| 13 | .asm-fullwidth { padding: 1rem; border-top: 1px solid #eee; font-size: 13px; overflow-x: auto; } | ||
| 14 | .asm-info { background: #f9f9f9; border: 1px solid #ddd; border-radius: 8px; padding: 1rem; margin-bottom: 1.5rem; font-size: 13px; line-height: 1.6; } | ||
| 15 | .asm-info h2 { font-size: 15px; margin: 0 0 0.5rem 0; color: #2C1A00; } | ||
| 16 | .ref-table { border-collapse: collapse; width: 100%; font-size: 12px; } | ||
| 17 | .ref-table th { background: #ccc; border: 1px solid #aaa; padding: 0.3rem 0.6rem; text-align: center; } | ||
| 18 | .ref-table td { border: 1px solid #ddd; padding: 0.3rem 0.6rem; text-align: center; } | ||
| 19 | .ref-table tr:nth-child(odd) td { background: #f9f9f9; } | ||
| 20 | .ref-table tr:nth-child(even) td { background: #fff; } | ||
| 21 | .code-block { background: #f4f4f4; border: 1px solid #ddd; border-radius: 4px; padding: 0.6rem 0.8rem; font-family: 'Courier New', monospace; font-size: 12px; line-height: 1.6; white-space: pre; overflow-x: auto; } | ||
| 22 | .warning { color: #c00; font-weight: bold; } | ||
| 23 | h1 { font-size: 18px; margin-bottom: 0.25rem; } | ||
| 24 | </style> | ||
| 25 | |||
| 26 | <div class="asm"> | ||
| 27 | |||
| 28 | <!-- Header --> | ||
| 29 | <div style="padding: 0.5rem 0 1rem 0;"> | ||
| 30 | <h1>AL5 Programming Tutorial — PS2 RC Rev. 1</h1> | ||
| 31 | <p><b>Updated January 11, 2012</b></p> | ||
| 32 | <p><span class="warning">Safety first!</span> Wear eye protection and never touch a powered robot!</p> | ||
| 33 | <p>The purpose of this guide is to set up the robot arm to be controlled via a PlayStation 2 game controller using a <b>BotBoarduino</b>.</p> | ||
| 34 | <p>Note: PS2 control programs have been verified to work with Lynxmotion wireless controllers. Non-Lynxmotion controllers cannot be guaranteed.</p> | ||
| 35 | </div> | ||
| 36 | |||
| 37 | <!-- Requirements --> | ||
| 38 | <div class="asm-info"> | ||
| 39 | <h2>What You'll Need</h2> | ||
| 40 | <p><a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-arms/" target="_blank">Any AL5 arm</a> · <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/botboarduino/" target="_blank">BotBoarduino</a> · PS2 Controller</p> | ||
| 41 | </div> | ||
| 42 | |||
| 43 | <!-- Step 1 --> | ||
| 44 | <div class="asm-step"> | ||
| 45 | <div class="asm-step-header"> | ||
| 46 | <div class="asm-step-name">AL5 PS2 RC (BotBoarduino) — Install Board</div> | ||
| 47 | <div class="asm-step-num">Step 1 / 4</div> | ||
| 48 | </div> | ||
| 49 | <div class="asm-step-body"> | ||
| 50 | <div class="asm-step-text"> | ||
| 51 | <p>Install the BotBoarduino as shown in Figure 1. Wire the board as shown in the schematic and Table 2 (Step 2). Verify all jumpers are correct.</p> | ||
| 52 | </div> | ||
| 53 | <div class="asm-step-figure"> | ||
| 54 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-arms/al5-programming-tutorial-ps2-botboarduino/WebHome/armbbu1.jpg"> | ||
| 55 | <span>Figure 1.</span> | ||
| 56 | </div> | ||
| 57 | </div> | ||
| 58 | </div> | ||
| 59 | |||
| 60 | <!-- Step 2 — tables + schematic --> | ||
| 61 | <div class="asm-step"> | ||
| 62 | <div class="asm-step-header"> | ||
| 63 | <div class="asm-step-name">AL5 PS2 RC (BotBoarduino) — Configure Jumpers & Connections</div> | ||
| 64 | <div class="asm-step-num">Step 2 / 4</div> | ||
| 65 | </div> | ||
| 66 | <div class="asm-step-body"> | ||
| 67 | <div class="asm-step-text"> | ||
| 68 | <p>Configure the BotBoarduino as illustrated in Table 2. For more information about setting up the force sensing resistor, see <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-arms/arm-gripper-fsr/" target="_blank">here</a>.</p> | ||
| 69 | </div> | ||
| 70 | </div> | ||
| 71 | <div class="asm-fullwidth"> | ||
| 72 | <div style="display:flex; flex-wrap:wrap; gap:1.5rem; margin-bottom:1rem;"> | ||
| 73 | <div style="flex:1 1 260px;"> | ||
| 74 | <p style="font-weight:bold; margin-bottom:0.4rem;">BotBoarduino Jumpers</p> | ||
| 75 | <table class="ref-table" style="margin-bottom:0.75rem;"> | ||
| 76 | <tr><th>Action</th><th>Setting</th></tr> | ||
| 77 | <tr><td>Connect</td><td>6.0VDC battery or wall pack to VS</td></tr> | ||
| 78 | <tr><td>Connect</td><td>9.0VDC battery to VL</td></tr> | ||
| 79 | <tr><td>Enable</td><td>Speaker</td></tr> | ||
| 80 | <tr><td>Connect</td><td>I/O 0-3 Power Bus to VS</td></tr> | ||
| 81 | <tr><td>Connect</td><td>I/O 4-7 Power Bus to VS</td></tr> | ||
| 82 | <tr><td>Connect</td><td>I/O 12-15 Power Bus to 5V</td></tr> | ||
| 83 | </table> | ||
| 84 | </div> | ||
| 85 | <div style="flex:1 1 260px;"> | ||
| 86 | <p style="font-weight:bold; margin-bottom:0.4rem;">BotBoarduino Connections (Table 2)</p> | ||
| 87 | <table class="ref-table"> | ||
| 88 | <tr><th>Pin</th><th>Function</th><th>Pin</th><th>Function</th></tr> | ||
| 89 | <tr><td>P1</td><td>N/A</td><td>P8</td><td>PS2 Data</td></tr> | ||
| 90 | <tr><td>P2</td><td>Base Rotate</td><td>P9</td><td>PS2 Clock</td></tr> | ||
| 91 | <tr><td>P3</td><td>Shoulder</td><td>P10</td><td>Wrist</td></tr> | ||
| 92 | <tr><td>P4</td><td>Elbow</td><td>P11</td><td>Gripper</td></tr> | ||
| 93 | <tr><td>P5</td><td>Speaker</td><td>P12</td><td>Wrist Rotate</td></tr> | ||
| 94 | <tr><td>P6</td><td>PS2 Attention</td><td>P13</td><td>N/A</td></tr> | ||
| 95 | <tr><td>P7</td><td>PS2 Command</td><td>A2</td><td>Force Sensing Resistor</td></tr> | ||
| 96 | </table> | ||
| 97 | </div> | ||
| 98 | </div> | ||
| 99 | <p><b>Schematic.</b> Double check your connections against the schematic below. You can check your PS2 cable colors and their functions <a href="https://wiki.lynxmotion.com/info/wiki/lynxmotion/view/servo-erector-set-system/ses-electronics/ses-modules/botboarduino/botboarduino-manual/#aglance" target="_blank">here</a>.</p> | ||
| 100 | <div style="text-align:center;"> | ||
| 101 | <img src="https://wiki.lynxmotion.com/info/wiki/lynxmotion/download/servo-erector-set-robots-kits/ses-v1-robots/ses-v1-arms/al5-programming-tutorial-ps2-botboarduino/WebHome/bbups2arm.png" style="max-width:100%; border:1px solid #ccc; border-radius:4px;"> | ||
| 102 | <p style="font-size:12px; color:#666; margin-top:0.3rem;">Schematic.</p> | ||
| 103 | </div> | ||
| 104 | </div> | ||
| 105 | </div> | ||
| 106 | |||
| 107 | <!-- Step 3 --> | ||
| 108 | <div class="asm-step"> | ||
| 109 | <div class="asm-step-header"> | ||
| 110 | <div class="asm-step-name">AL5 PS2 RC (BotBoarduino) — Download & Program</div> | ||
| 111 | <div class="asm-step-num">Step 3 / 4</div> | ||
| 112 | </div> | ||
| 113 | <div class="asm-step-body"> | ||
| 114 | <div class="asm-step-text"> | ||
| 115 | <p>Download and install the <a href="http://arduino.cc/en/Main/Software" target="_blank">Arduino Software</a>. Install the <a href="https://github.com/Lynxmotion/Arduino-PS2X/raw/master/PS2X_lib.zip" target="_blank">PS2X library</a> — instructions for installing libraries are <a href="http://arduino.cc/en/Reference/Libraries" target="_blank">here</a>. Download the arm code <a href="https://github.com/Lynxmotion/Arms/zipball/Botboarduino" target="_blank">here</a>.</p> | ||
| 116 | <p>Open the .ino file and locate the arm selection section near the top. Remove the comments (<code>//</code>) from in front of the arm you are using. The code defaults to AL5D — if using another arm, add <code>//</code> before the AL5D line (see Table 3).</p> | ||
| 117 | <p>If using an FSR on the gripper, uncomment the line <code>#define FSRG</code>.</p> | ||
| 118 | <p>When finished, save your program and click "Upload".</p> | ||
| 119 | </div> | ||
| 120 | <div class="asm-step-figure" style="flex: 0 1 340px;"> | ||
| 121 | <p style="font-weight:bold; font-size:12px; margin-bottom:0.4rem;">Table 3 — Arm Selection</p> | ||
| 122 | <div class="code-block">//comment to disable the Force Sensitive Resister on the gripper | ||
| 123 | //#define FSRG | ||
| 124 | |||
| 125 | //Select which arm by uncommenting the corresponding line | ||
| 126 | //#define AL5A | ||
| 127 | //#define AL5B | ||
| 128 | #define AL5D</div> | ||
| 129 | </div> | ||
| 130 | </div> | ||
| 131 | </div> | ||
| 132 | |||
| 133 | <!-- Step 4 --> | ||
| 134 | <div class="asm-step"> | ||
| 135 | <div class="asm-step-header"> | ||
| 136 | <div class="asm-step-name">AL5 PS2 RC (BotBoarduino) — Controller Reference</div> | ||
| 137 | <div class="asm-step-num">Step 4 / 4</div> | ||
| 138 | </div> | ||
| 139 | <div class="asm-fullwidth"> | ||
| 140 | <p style="font-weight:bold; margin-bottom:0.5rem;">PS2 Controls — Table 4</p> | ||
| 141 | <table class="ref-table"> | ||
| 142 | <tr><th>Button</th><th>Function</th><th>Button</th><th>Function</th></tr> | ||
| 143 | <tr><td>L Joy Up</td><td>Gripper Angle Up</td><td>R Joy Up</td><td>Gripper Up</td></tr> | ||
| 144 | <tr><td>L Joy Down</td><td>Gripper Angle Down</td><td>R Joy Down</td><td>Gripper Down</td></tr> | ||
| 145 | <tr><td>L Joy Left</td><td>Base Rotate Left</td><td>R Joy Left</td><td>Gripper Back</td></tr> | ||
| 146 | <tr><td>L Joy Right</td><td>Base Rotate Right</td><td>R Joy Right</td><td>Gripper Away</td></tr> | ||
| 147 | <tr><td>L1</td><td>Wrist Rotate CW</td><td>R1</td><td>Gripper Close</td></tr> | ||
| 148 | <tr><td>L2</td><td>Wrist Rotate CCW</td><td>R2</td><td>Gripper Open</td></tr> | ||
| 149 | <tr><td>L3</td><td>N/A</td><td>R3</td><td>N/A</td></tr> | ||
| 150 | <tr><td>D-Pad Up</td><td>Increase Speed</td><td>△ Triangle</td><td>Center Wrist Rotate</td></tr> | ||
| 151 | <tr><td>D-Pad Down</td><td>Decrease Speed</td><td>X Cross</td><td>Fully Open Gripper</td></tr> | ||
| 152 | <tr><td>D-Pad Left</td><td>N/A</td><td>□ Square</td><td>N/A</td></tr> | ||
| 153 | <tr><td>D-Pad Right</td><td>N/A</td><td>O Circle</td><td>N/A</td></tr> | ||
| 154 | <tr><td>Start</td><td>Enable / Disable Arm</td><td>Select</td><td>N/A</td></tr> | ||
| 155 | </table> | ||
| 156 | </div> | ||
| 157 | </div> | ||
| 158 | |||
| 159 | </div> | ||
![]() |
23.1 | 160 | {{/html}} |


