Numbers are how far (centimetres) or how much to turn (degrees), and which slot a program lives in.
Hold an arrow and the robot goes that way. Let go and it stops. ▲ forward, ▼ back, ◀ ▶ slide sideways (mecanum wheels!).
Hold 1 or 3 to turn left or right on the spot.
0, OK or # stop it.
If something is closer than 25 cm in front, the robot will not drive forward (the sonar sees it). Back up, slide or turn instead.
A. Switch to Program Mode: *** the robot wiggles = "I am listening"
B. Add a step: * then a direction then a number. The first key after the * is always the move; the next * ends the number. The robot nods = "got it".
C. Add another step: * and the next move. Any of these:
D. Done: *** the robot wiggles = "which slot?"
E. Save it: a slot number 1..9 then ** the robot nods = saved.
* then the slot number: *3 runs the program in slot 3.
Any key stops it. An empty slot gets a slow head shake.
Up to 16 steps in a program, 9 slots. Programs stay on the robot when it is switched off.
*0 is always program 0: a circle 1 m across, facing in.
Out of the box the slots hold nine demos: 1 square, 2 crab box (slides only), 3 out and back, 4 triangle, 5 stairs, 6 spiral, 7 look around, 8 figure 8, 9 dance. Saving your own program in a slot replaces its demo.
Point the remote at the robot's receiver (the little black eye). Press keys one at a time. Wait for the nod before the next step.
Pressed * by mistake? Nothing happens if you wait 3 seconds. # always gets you out.
*** *▲30 *3 *▲30 *3 *▲30 *3 *▲30 *3 *** 1**
Forward 30 cm and turn right, four times, saved in slot 1. Run it with *1. Does it end where it started? If not, the robot needs calibrating.
Flash ir.ino (Arduino IDE, Uno). It drives on the same motion numbers as mecanum_holonomic.ino, including a set saved by the Calibrate / Tune page.
IR receiver (3 pins: OUT, VCC, GND): OUT to D10, the signal pin of the shield's SER1 servo header, 5 V and GND beside it. No soldering. Any other pin works too: change IR_RECEIVER_PIN at the top of the sketch (the robot says which pin it uses when it boots).
Sonar (HC-SR04) stays where the kit puts it: trig A3, echo A2. Under 25 cm ahead = stop. SONAR_STOP_MM sets the distance; SONAR_STOPS_EVERYTHING makes it stop every move, not only forward ones.
The remote is the kit's 17-key one (arrows, OK, 0-9, * #). Another remote prints ir: key 0x.. not mapped in the console below; its codes go in IR_KEYS.
Three quick steps to get programmed moves in the ballpark. A test only runs when you press OK, so put the robot on a mark first; * runs the current test again whenever you want to re-measure. You type what you measured. The numbers are saved on the robot (the same place the Calibrate / Tune page saves), on top of the code's numbers. Strafing is left alone. You need a tape measure and a metre of floor.
| Step | What happens | You press |
|---|---|---|
| Start | wiggle, then a short forward pulse at the start power | ### |
| 1 Start power | Each press pulses again. Go down until it stops moving, then up until it just moves. | ▼ less, ▲ more, OK keeps it (nod) |
| 2 One metre | Put it on a mark. OK drives forward 1 m. Measure how far it really went. | OK to drive, then the cm, e.g. 94, then OK |
| 2 Drift | Did it end left or right of a straight line? | ◀ or ▶, the cm, OK (OK alone = straight) |
| 3 Four turns | Mark where it faces. OK turns right 90 four times. Is it facing the way it started? | OK to turn, then ▶ degrees past, or ◀ degrees short, OK |
| Saved | nod + wiggle: the numbers are on the robot. Run ### again to refine; each round builds on the last. |
* runs the current step's test again (the pulse, the metre, the four turns) and drops any digits typed so far. # cancels and puts the saved numbers back. To go back to the code's numbers, send kd; from the command box below.
Connect to a robot running ir.ino. Every key it hears shows up here, and the remote drawing above becomes a remote: tap its keys.
| Command | Does |
|---|---|
i<keys>; | press remote keys: U D L R O(k) * # 0-9. i***; then iU50*; then i***; ... exactly what a kid would press. |
p?; | list the slots: P,3,f50,t90 (f b l r in cm, t in degrees, t-90 = left) |
p3; | run slot 3 |
p3=f50 t90 n4; | store a program in slot 3 from the phone: f b l r cm, q e diagonals cm, t degrees (t-90 left), p pause s, n do it all again times (p3=; empties it). The Blocks editor builds these lines from block programs and can send all nine slots at once. |
u | one sonar reading, U,<mm> (-1 = nothing within 4 m) |
v40,0,0; | keep driving forward / right / clockwise at -100..100 % (the Blocks page's keep-driving blocks and the Sticks page); stops unless repeated within half a second; the sonar zeroes the forward part near a wall |
x | stop |
m0,500,0; k?; | a move and the motion numbers, as in calibration.ino |
| Nothing happens on any key | Is ir.ino on the robot (connect: the status says ir)? Is the receiver's OUT on the pin the robot names at boot? Try the keys from this page: if those work, it is the receiver or the remote's battery. |
| Some keys are missed | Point straight at the eye; sunlight and some LED lights blind receivers. Press keys one at a time and wait for the nod. |
| It will not go forward | Something is within 25 cm of the sonar, or the sonar is unplugged and reads 0. Check with Sonar reading. |
| Distances or turns are off | It drives on the calibration numbers: Calibrate / Tune, then try the square again. |
| Too wobbly when it nods / wiggles | GESTURE_PWM_OVER_START and GESTURE_TWITCH_MS in the sketch. |