Centauri Academy Open the Academy
Robotics division scene at dusk, the Academy’s silver star in the sky

Robotics · Ensign mission · Silver shield

If This, Then That

With a micro:bit or similar board and your grown-up, choose one sensor: light, temperature, tilt, sound level, or a button. Choose three ranges for it, and what the machine will do in each. For example, with the light sensor: if it is dark, show a moon and switch on a light; if it is dim, show a cloud; if it is bright, show a sun and play a tune. Draw the logic first, as a flowchart with "if", "else if" and "else" boxes, and decide the exact numbers where each range starts and stops. Then code it. Test every branch deliberately: make it dark, dim and bright, and check it does the right thing each time, at least five times each. Then test the edges: what happens exactly at your boundary numbers? Fix anything that is wrong. Finally, give your machine a real job, such as a night light, a fridge-door alarm, or a "too noisy" warning for a room.

Open in the app

Age
10 and over
The real skill
Conditional logic with sensor input
Rank
Ensign
Shield
Silver

The real-world skill

In the real world this is conditional logic with sensor input: designing if, else-if and else branches over defined thresholds, flowcharting before coding, testing every branch and the boundary values, and applying the program to a real task, the core of all embedded programming.

How it runs: an Ensign mission: the grown-up checks the build and helps with downloading, the Ensign plans the logic, codes it and tests every branch.

What you actually do

Every Academy mission is a real task told as a story. The left column is the real thing; the right is what the briefing calls it.

What you actually doWhat the mission calls it
Choose one sensorThe engine's input
Three ranges, three actionsChoosing between steps
Draw the flowchart firstLovelace's notes
Exact boundary numbersDepending on its results
Code itThe first program
Test every branch, five timesStep by step
Test the edgesWhere choices change
Give it a real jobMusic and pictures

The ground rules

Written for the grown-up. These are part of the mission, not extras.

  • Battery packs or USB from a computer only; never mains adapters you have opened or changed.
  • No recording of sound or images: sound level only, if you use the microphone.
  • Fridge-door or room alarms only with the family's agreement, and nothing that wakes or upsets people.
  • The grown-up checks any extra parts you connect before switching on.

From the briefing

Ensign, in 1843 a mathematician called Ada Lovelace published some notes about a machine that had not yet been built. Her friend Charles Babbage had designed a huge mechanical calculator he called the Analytical Engine. In her notes, Lovelace explained how it could be given a series of instructions to work through a complicated calculation, step by step, and how it could repeat some steps and choose between others depending on its results. She also imagined that such a machine might one day work with music and pictures, not just numbers. Her notes are often called the first computer program, more than a hundred years before the first electronic computers.

The full briefing, the officer’s welcome back and the silver shield are in the app.