Two buttons on a web page turn the board's LED on and off. The simplest possible start — no frameworks at all.
The simplest possible Pardalote sketch. A web page with two buttons that turn the Arduino's built-in LED on and off over WiFi — no p5.js, no framework.
#include <Pardalote.h>
void setup() {
Pardalote.begin();
// Connect on either USB or WiFi. Moving from USB to WiFi requires a board reset.
}
void loop() {
Pardalote.run();
}
const LED = 13; // the LED pin (13 is the board's built-in LED)
const arduino = new Arduino();
setupConnection(arduino, { store: 'pardalote-basic-light-switch' });
// Configure the pin whenever the board is ready (it forgets pins on reset).
arduino.on('ready', () => arduino.pinMode(LED, OUTPUT));
// Browser → Arduino: the buttons send a digitalWrite.
document.getElementById('led-on').onclick = () => arduino.digitalWrite(LED, HIGH);
document.getElementById('led-off').onclick = () => arduino.digitalWrite(LED, LOW);
digitalWrite(13, HIGH) to the ArduinodigitalWrite(13, LOW) to the ArduinoIn Arduino IDE: File → Examples → Pardalote → minimal-pardalote
Select your board and upload
Open the Serial Monitor at 115200 baud — on first boot Pardalote asks for your WiFi credentials:
=== Pardalote ===
No WiFi networks stored.
=== WiFi Configuration ===
[a]dd [d]elete [c]lear all [s]how [x] exit
> a
SSID: YourWiFiName
Password: ********
Saved: YourWiFiName
> x
Credentials are saved to EEPROM and survive re-uploads. Press w in the Serial Monitor at any point while the board is trying to connect to update them.
Prefer compile-time credentials? Uncomment the two lines in secrets.h:
#define SECRET_SSID "YourWiFiName"
#define SECRET_PASS "YourWiFiPassword"
If both are configured, secrets.h is tried first.
Find your Arduino's IP address:
Open index.html in a browser. In the Board row, enter the Arduino's IP
(or switch to USB) and press Connect — the button turns green when it's
up, and your choice is remembered per browser (a return visit reconnects with
one click). The LED pin is set at the top of sketch.js (const LED, 13 = the
built-in LED). Click Turn LED ON and Turn LED OFF.
const LED = 13; // 13 is the board's built-in LED
const arduino = new Arduino();
setupConnection(arduino, { store: 'pardalote-basic-light-switch' }); // Board row + connection (connect.js)
arduino.on('ready', () => arduino.pinMode(LED, OUTPUT)); // set up the pin once connected
// Button handlers
arduino.digitalWrite(LED, HIGH); // ON
arduino.digitalWrite(LED, LOW); // OFF
pinMode is called inside the ready handler — this ensures the WebSocket is open before the frame is sent. Calls made before ready would be silently dropped.
Reconnection is automatic. If the Arduino resets or the connection drops, Pardalote reconnects and restores the pin configuration.
"Buttons don't work"
"IP shows as 0.0.0.0" (UNO R4)
w on boot)"LED doesn't light up" (ESP32)
basic-light-switch/
├── index.html # Two-button web interface
├── sketch.js # Arduino connection and button handlers
├── connect.js # Board connection UI (WiFi / USB, remembered per browser)
└── README.md # This file
dist/
└── pardalote.js # Pardalote bundle (core + all extensions)
potentiometer-p5jsservo-controlneopixel