Overview
The library is the bridge between your Arduino sketch and the InstantIoT app. The app sends commands when the user interacts with a Controller; your sketch reacts. Your sketch pushes sensor values; the app shows them on a Display. The library handles the wire.
[image] Diagram: phone ↔ library ↔ Arduino sketch
What the library does
Every sketch you write with InstantIoT does three things:
- Setup —
#includethe connection mode you want, declare aninstantobject, callinstant.begin(...)insetup(), callinstant.loop()inloop(). - React to user input — Drop
WHEN_*blocks at global scope, inside anI<Widget>("widget_id") { ... }macro. The library calls them when the user interacts. - Push data back — Call methods on
instant.<widget>("widget_id")from a timer to update Displays on the dashboard.
The widget is configured in the app — its look, its range, its colors, its labels. The sketch only deals with what to do when the user interacts, and what to send when a sensor changes. The two halves stay independent: redesign the dashboard without touching the sketch, or rewrite the sketch without touching the dashboard.
How this section is organized
→ Setup — Install the library and write your first sketch.
→ Receive command from App — All the WHEN_* blocks, by widget category.
→ Send data to App — All the methods to push values to Display widgets.
→ Manage Connections — Choose between Direct Mode and Server Mode (and more to come).
→ Examples — Three complete sketches you can flash and adapt.