Maker Lab Kids
Remote Robot
Not connected

Drive and program the robot with the remote

The remote

1turn left
2
3turn right
4
5pause
6
7diagonal
8again
9diagonal
*program
0stop / circle
#cancel
▲
◀
OK
▶
▼
forward slide left slide right back stop / try it

Numbers are how far (centimetres) or how much to turn (degrees), and which slot a program lives in.

1. Drive

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.

2. Make a program

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.

No number? *▲ is 25 cm, *3 is a 90 degree turn, *5 is 1 second, *8 is 2 times, *0 is 1 m across.
Oops: # throws the program away (slow head shake). **** and a slot number adds to the program saved there instead of starting fresh.
Example: out, turn, back a bit, saved in slot 2
***wiggle = listening
*▲50forward 50 cm
*390turn right 90 degrees
*▼20back 20 cm
***wiggle = which slot?
2**nod = saved in slot 2
After each step the robot nods = "got it".

3. Run a program

* 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.

Tips

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.

What the robot is saying

Wiggle (quick left-right)
"I am listening" / "which slot?"
Nod (forward-back)
"Got it": step kept, program saved
Slow head shake
"No": cancelled, empty slot, program full
Stops dead
Something is in front of it (sonar), or a key was pressed

Try this: a square

*** *▲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.

Or try this shortcut to also make a square
***wiggle = listening
*▲forward
*3turn right
*84do it all again, 4 times in all
***wiggle = which slot?
1**nod = saved in slot 1
Three steps instead of eight. No number after ▲ means 25 cm, none after 3 means 90 degrees, and 84 repeats everything before it until it has gone round 4 times in all: a 25 cm square.

Instructor

Set up a robot

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.

Calibrate from the remote: ###

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.

StepWhat happensYou press
Startwiggle, then a short forward pulse at the start power###
1 Start powerEach press pulses again. Go down until it stops moving, then up until it just moves.▼ less, ▲ more, OK keeps it (nod)
2 One metrePut 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 DriftDid it end left or right of a straight line?◀ or ▶, the cm, OK (OK alone = straight)
3 Four turnsMark 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
Savednod + 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.

Watch and drive from here

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.

Commands you can type to the robot
CommandDoes
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.
uone 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
xstop
m0,500,0; k?;a move and the motion numbers, as in calibration.ino
Robot messages

If it does not work

Nothing happens on any keyIs 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 missedPoint 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 forwardSomething is within 25 cm of the sonar, or the sonar is unplugged and reads 0. Check with Sonar reading.
Distances or turns are offIt drives on the calibration numbers: Calibrate / Tune, then try the square again.
Too wobbly when it nods / wigglesGESTURE_PWM_OVER_START and GESTURE_TWITCH_MS in the sketch.