Write and deploy code to your ESP32 devices from anywhere. No need for physical access!
Use AssemblyScript or TinyGo to write your code. More languages coming soon!
Broadcast events between devices without needing a backend. Seamless communication made simple.
With Flibbert, you can easily create a system where one ESP32 device measures soil moisture and notifies another device to start watering when the soil is dry.
Here’s how it works:
import {
digitalRead,
sleep,
broadcast,
} from "./bindings";
export function main(): void {
while (true) {
// Read the sensor value
const sensorValue = digitalRead(sensorPin);
// If the soil is dry, emit a event
if (sensorValue < 300) {
broadcast("dry_soil", sensorValue);
}
// Sleep for 5 minutes
sleep(5 * 1000 * 60);
}
}
import {
digitalWrite,
sleep,
subscribe,
} from "./bindings";
const waterSwitchPin = 7;
function handleDrySoil(): void {
// Start a water for 30 secs
digitalWrite(waterSwitchPin, 1);
sleep(30 * 1000);
digitalWrite(waterSwitchPin, 0);
}
export function main(): void {
subscribe("dry_soil", handleDrySoil);
}