Script

The Script section describes how to create and manage logic that runs on your R1BBIT device. Scripts allow you to process data, work with variables, interact with widgets, and control device behavior in real time.

Using scripts, you can:

  • Read and write user variables
  • Receive data from widgets and sensors
  • Send values to the R1BBIT Cloud
  • Define conditions, calculations, and automation logic
  • React to user input and external events

Scripts are the core of device behavior, enabling flexible customization and advanced scenarios without changing hardware.

// MAIN LANGUAGE OPERATORS AND CONSTRUCTS
VAR A, B, C              // VARIABLE DECLARATION
A = 10                   // ASSIGNMENT
B = A * 2 + 5             // ARITHMETIC OPERATIONS: + - * / 

IF A > 5 THEN             // CONDITIONS
    C = 1
ELSE
    C = 0
ENDIF

WHILE A < 100             // LOOP
    A = A + 1
WEND

PAUSE 1000                // DELAY IN MILLISECONDS

PRINT A                  // OUTPUT TO TERMINAL

VARS_READ(A, B)           // SEND VARIABLES TO R1BBIT CLOUD (WI-FI)

Full documentation for the built-in language is available here.