Circuit Biscuits

Lesson 10 - Automation Tool And Control Logic Pupil Notes

Automation turns live values into decisions and actions. In this lesson we use conditions, waits, and actions to build small reactive behaviours.

In This Lesson

Lesson 10 Pupil Notes

Title

Automation Tool And Control Logic

Big Question

How can the board react automatically instead of waiting for us to press every button by hand?

What This Lesson Is About

Automation turns live values into decisions and actions. In this lesson we use conditions, waits, and actions to build small reactive behaviours.

Key Words

  • automation
  • condition
  • action
  • routine
  • telemetry
  • reactive

Before You Start

  • Open the automation panel.
  • Think about one sensor value you could watch.
  • Decide what the board should do if that value changes.

What To Remember

  • telemetry gives us live values from the board
  • automation checks conditions against those values
  • actions tell the system what to do next
  • waits help control timing and prevent chaotic behaviour
  • browser automation and device automation are related but not identical

What We Did

  • loaded an example routine
  • edited the routine to make it our own
  • saved the routine to a file
  • looked at the JSON structure of the routine
  • previewed the routine in the browser
  • sent the routine to the device and ran it there

What To Look For

  • what value is the routine watching?
  • what threshold makes it react?
  • what should happen when the condition becomes false again?
  • does the routine behave smoothly or flicker too much?
  • which parts of the routine work in the browser only, and which can run on the device too?

Try This

  1. Load one example routine from the example gallery.
  2. Change at least one part of it:
  • the threshold
  • the text
  • the mode
  • the wait time
  1. Save the routine to a file.
  2. Open the saved file and look at the JSON.
  3. Preview the routine in the browser.
  4. If the routine is device-safe, send it to the board and run it on the device.

Explain the routine as:

  • input
  • decision
  • action

Look At The JSON

When you save an automation routine, it is stored as JSON.

JSON stands for JavaScript Object Notation. It is a common way to store structured data in a readable text form.

In an automation file, JSON helps us describe things like:

  • whether the routine loops
  • what steps it contains
  • what each step type is
  • what condition or action each step uses

You may see parts like:

{
  "loopEnabled": true,
  "steps": [
    {
      "type": "if_value",
      "variable": "distance_cm",
      "operator": "<",
      "value": 20
    }
  ]
}

That means:

  • the routine repeats
  • it has steps
  • one step is an if check
  • it looks at distance_cm
  • it compares that value with 20

Looking at the JSON is useful because it shows the routine as data, not just as boxes on screen.

Browser Preview And Device Run

The browser preview is good for quick testing because you can change things fast and see what happens immediately.

Running on the device is different:

  • the routine is sent to the board
  • the board stores or runs the logic itself
  • the routine can keep working without the browser doing every step

Some routines work in both places, but some are browser-only. For example, local audio and speech are browser features, not firmware features.

Why It Matters

Automation is a key step from manual control toward genuinely intelligent or reactive systems.

Check Yourself

  • What is telemetry?
  • What is the condition in your routine?
  • What action does the board take?
  • Why might a wait be useful?
  • What is one difference between browser automation and device automation?
  • What is JSON used for in this lesson?

Reflection

  • The example routine I started with:
  • One thing I edited:
  • One useful thing I noticed in the JSON:
  • Did my routine work in browser preview, on device, or both?
  • The input my routine used:
  • The action it took:
  • One thing that made the routine work better:
  • One real product that depends on automation: