Logic
Branch the flow with If, Switch and Repeat — built in, nothing to install.
The Logic actions decide where the flow goes next. They're built into the platform, so they're in every action picker (the Logic group) without adding a component, and the board runs them itself.
Every operand is a normal configuration: type a value, or bind it to an output, a
variable or a Code field. A Code operand keeps the type its script returns
— return ctx.get("result")["status"] is the number 200, so is greater than compares numbers.
If
Goes out True or False.
| Configuration | What it does |
|---|---|
| Value | What to test — e.g. bind an Ultrasonic sensor's distance. |
| Condition | How to test it (see below). |
| Compare to | What Value is compared with. Hidden for conditions that don't need it. |
| Combine | Add a second condition: AND (both must hold) or OR (either one). |
With Combine set, Value 2, Condition 2 and Compare to 2 appear.
Switch
Routes the flow by value. It goes out the first case that matches, or Default when none
does. Match picks how Value is compared with each case (equal by default, or greater than,
contains…). An empty case never matches. The canvas shows each case's value next to its output,
e.g. Case 1 · 10.
Add case (under its settings) adds Case 4, 5… — up to 12 — each with its own output, before Default. The × on a case removes it, and the ones after it move up a number, keeping their values and their wires.
Outputs per action
A board wires 4 outputs of an action by default (say Case 1–3 + Default). For more, raise Outputs per action in the workflow's Settings → Limits, then compile and upload again — the studio says so next to Add case.
Repeat
Runs the Loop branch Times times, then goes out Done. Wire the loop's last action back
into Repeat's input. While looping, it publishes iteration (1 on the first time round): bind it
like any output.
The count goes back to zero once Repeat is Done, and at every new run from Start.
Conditions
| Condition | Holds when |
|---|---|
| is equal to / is not equal to | The two sides are equal, as numbers when both are (10 = 10.0), as text otherwise. |
| is greater / less than (or equal to) | Both sides are numbers and the comparison holds. |
| contains / does not contain | Value's text includes Compare to's (or doesn't). |
| starts with / ends with | Value's text begins or ends with Compare to's. |
| is true / is false | Value is true, non-zero, or text like on, yes, 1, high — or isn't. |
| is empty / is not empty | Value has no text, or never got a value. |
A Value that never got one (an unbound field, or a binding whose source hasn't run) fails every comparison and counts as empty.
Platform version
Logic needs a board flashed with a platform that has it. A board with an older one refuses the workflow when it's uploaded: flash it again.