> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hyperwisor.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Arduino — Examples

> Worked examples shipped with the Hyperwisor Arduino library.

The library ships a set of example sketches (**File → Examples → Hyperwisor-IOT**
after installing). Each is a focused, runnable starting point.

## BasicSetup

The minimal sketch — initialize, connect, and stay connected.

```cpp theme={null}
#include <hyperwisor-iot.h>

HyperwisorIOT device;

void setup() {
  Serial.begin(115200);
  delay(1000);

  // Initialize the device.
  // With no saved credentials it starts in AP mode for provisioning.
  device.begin();

  Serial.println("Device ID: " + device.getDeviceId());
}

void loop() {
  // Keep the connection alive and handle incoming messages
  device.loop();
}
```

On first upload, connect to the `NIKOLAINDUSTRY_Setup` Wi-Fi (password
`0123456789`), configure your Wi-Fi and device details, and the device restarts
and connects automatically.

## Example index

| Example                                | What it shows                                            |
| -------------------------------------- | -------------------------------------------------------- |
| **BasicSetup**                         | Minimal init + connection                                |
| **CommandHandler**                     | Receiving dashboard commands via `setUserCommandHandler` |
| **GPIOControl**                        | Driving GPIO from commands                               |
| **WidgetUpdate**                       | Pushing live values with `updateWidget`                  |
| **SensorDataLogger**                   | Logging sensor readings                                  |
| **WiFiProvisioning**                   | The AP-mode provisioning flow                            |
| **Manual\_Provisioning\_Example**      | Setting credentials from code                            |
| **Conditional\_Provisioning\_Example** | Provisioning based on a condition                        |
| **AttitudeWidget\_MPU6050**            | Flight attitude widget from an MPU6050                   |
| **ThreeDWidgetControl**                | Driving a 3D model widget                                |
| **FSR\_Pressure\_Sensor**              | Reading an analog pressure sensor                        |
| **i2c\_PCF8574\_relay**                | I²C relay control                                        |

<Note>
  Example names and contents track the library repository. If a sketch differs
  from what's shown here, the sketch in your installed library version is the
  source of truth.
</Note>

<Card title="API reference" icon="book" href="/firmware/arduino/api-reference">
  Every method used in these examples.
</Card>
