Select Page

I spent a lot of time over the Thanksgiving week sorting and rebuilding the LEGO Mindstorms kits. Here and here.

Today all of the groups at LEGO club had a working robot; complete with two motors and the light sensor.

The challenge today was to make the robot roll forward in the ‘Shark Tank’ (the light coloured floor), detect the dark edge of the carpet, stop and then reverse up.

Initially all of the teams had a go at programming this; the usual combination of loops and guesswork. I then moved on to ‘human prototyping’. Two of the LEGO group – Ben and Jonathon – became my motors and sensors. I had the entire group verbally express what should be happening:

Ben walks forward

until

Jonathan is on the carpet

then

Ben walks backward

I introduced the concept of both the LEGO ‘move’ and ‘wait’ blocks.

The next iteration was much better; most of the teams got the move – wait – move concept; the difficulty was working on the sensor values. Showing the on-brick sensor values (reflected light on floor = 54; reflected light on dark carpet = 32) really helped – back to the human prototype – Jonathon held his arms in the air (the high value) and dropped his arms (low value).

Finally some debugging (greater than, less than confusion; tweaking sensor values) and everyone had a working ‘edge sensor robot’.

Here’s the visual:

shark-pool-edged

Here is a link to the tiny program shark-pool-edge.rbt from this morning.