Blocks Reference
Catalog of available blocks and how they translate to Arduino-style C++ for ESP32.
About the Blocks
Powered by Google Blockly with custom code generators that output Arduino-style C++.
Start
- Setup once — Adds lines to
setup(). - Repeat forever — Contents become the
loop()body.
Control
- Repeat times (n) — Loop a block of statements
ntimes. - Wait (seconds) — Emits
delay(seconds * 1000)inloop(). - If — Standard conditional.
Logic
- Compare —
==, !=, <, >, <=, >=. - Boolean —
trueorfalse.
Pins
- Pin mode — Emits
pinMode(pin, INPUT/OUTPUT)insetup(). - Digital write — Emits
digitalWrite(pin, HIGH/LOW)inloop(). - Built‑in LED — Shortcut to control the board LED if available.
- Read button — Emits
digitalRead(pin).
Sensors
- Ultrasonic setup — Initializes NewPing with trigger/echo pins and injects required
#includeand globals. - Ultrasonic read (cm) — Returns distance in centimeters.
Actuators
- Servo attach — Uses ESP32Servo to attach a servo and adds necessary
#includeand global instance. - Servo write (°) — Sets servo angle from 0–180°.
Math
- Number — Numeric literal.
- Arithmetic — Add, subtract, multiply, divide.