R1BBIT · EMBEDDED LANGUAGE
R1BBIT Script
A compact, BASIC-style language purpose-built for IoT. Control hardware, draw graphics, read sensors, and build interactive UI — in a few lines of code.
Why R1BBIT Script
Built around a single idea: make embedded programming feel effortless.
Instant to learn
BASIC-inspired syntax. If you've ever written a few lines of code, you're already productive.
Hardware-first
Built-in commands for ADC, PWM, DAC, I2C, RTC, WS2812 — no libraries, no boilerplate.
Graphics engine
Native support for ST7735, ILI9341, ILI9488, ST7796, ST7789, SSD1306 with shapes, text, bitmaps and sprites.
Sensor ready
DHT, BMP280, SHT21, CCS811, VL53L0X, HX711, DS18B20, MAX30102 — all one-liners.
Interactive widgets
Buttons, sliders, gauges, graphs and progress bars with real-time variable binding and touch.
Cloud by default
Push variables to R1BBIT Cloud over Wi-Fi with a single call. Dashboards from your phone, anywhere.
Signal processing
128-bin FFT at 16 kHz with asymmetric EMA smoothing — responsive spectrum visualizations out of the box.
2D arrays & matrices
32 KB memory pool, range-based init, linear addressing, copy operations — real data structures, not toys.
See it in action
A few snippets that show the language's character.
VAR A, B, C // variable declaration
A = 10 // assignment
B = A * 2 + 5 // arithmetic: + - * / %
IF A > 5 THEN // conditions: = == <> < > <= >= AND OR
C = 1
ELSE
C = 0
ENDIF
FOR I = 0 TO 9 STEP 1 // FOR / NEXT loop
PRINT I
NEXT
WHILE A < 100 // WHILE / WEND loop
A = A + 1
WEND
PAUSE 1000 // delay in milliseconds
PRINT A.h // formatted output (.h hex, .b binary, .Nz zero-pad)
DISPLAY_INIT ILI9341, SPI, ROT_0
VAR COLOR
COLOR = RGB565(255, 140, 0) // orange
DISPLAY_CLEAR RGB565(0, 0, 0)
DISPLAY_RECT_FILL 10, 10, 220, 60, COLOR
DISPLAY_TEXT 20, 25, "HELLO R1BBIT", 2, COLOR
DISPLAY_CIRCLE 120, 160, 40, RGB565(0, 200, 255)
VAR POLY[6] = {50,200, 120,260, 190,200, 50,200}
DISPLAY_POLYGON POLY, RGB565(100, 255, 100)
VAR TEMP, HUM
BMP280_INIT
DHT_INIT PIN_5
WHILE 1
DHT_READ TEMP, HUM // temperature + humidity
PRINT "T=", TEMP, " H=", HUM
VARS_SEND(TEMP, HUM) // push to R1BBIT Cloud over Wi-Fi
PAUSE 5000
WEND
VAR VOLUME = 50
SLIDER_INIT 20, 100, 200, 30, 0, 100, VOLUME
GAUGE_INIT 160, 200, 60, 0, 100, VOLUME, "VOLUME"
BUTTON_INIT 20, 260, 100, 40, "MUTE", TOGGLE, ON_MUTE
WHILE 1
PAUSE 20 // widgets update automatically
WEND
ON_MUTE:
VOLUME = 0
RETURN
Under the hood
Everything that ships with the interpreter.
Data Types
Scalars, 1D arrays, 2D matrices — shared 32 KB pool
Number Bases
Decimal, hex (0x…), binary (0b…) — with output format specifiers
Control Flow
IF/ELSE IF/ENDIF, FOR/NEXT (STEP), WHILE/WEND — up to 5 levels deep
Math
ABS, SIN, COS, TAN, ROUND, FLOOR, CEIL, RND, AND/OR/XOR/NOT
Displays
ST7735, ILI9341, ILI9488, ST7796, ST7789, SSD1306 (SPI / I2C)
Graphics
Pixel, line, polyline, rect, circle, polygon (3–30 pts), bitmap, text (1–8×)
Color
RGB565, RGB666, RGB888 with helper conversions
Sensors
DHT, BMP280, SI7021, SHT21, AHT21, CCS811, VL53L0X, APDS9930, HX711, DS18B20, MAX30102
Signal Processing
128-bin FFT @ 16 kHz with EMA smoothing (asymmetric attack/decay)
Peripherals
ADC ×6, PWM (timer+channel), DAC (MCP4725), I2C scan, RTC, WS2812
Widgets
BUTTON, STEPPER, PROGRESS, GAUGE, SLIDER, GRAPH — with touch binding
Touch
FT6336U capacitive with coordinate + state tracking
Cloud
Push/pull variables to R1BBIT Cloud over Wi-Fi — single command
Event Model
GOSUB/RETURN handlers bound to widgets — no callbacks, no state machines
Ready to write your first script?
The full command reference lives in one page — bookmark it and start building.
Open Full Documentation