Blocks
Last updated
Last updated
Blocks |
---|
Blocks |
---|
Blocks |
---|
Blocks |
---|
Blocks |
---|
Blocks |
---|
Blocks |
---|
Blocks |
---|
if – else if – else — if
, else if
, else
logic comparisons — ==
, !=
, <
, <=
, >
, >=
logic operations — and
, or
logical not — not
boolean true/false — true
, false
boolean high/low — HIGH
, LOW
ternary operaor — test ? true : false
wait s — delay()
wait ms — delay()
wait μs — delayMicroseconds()
run time in ms — milliseconds()
run time in μs — microseconds()
wait forever — while true
number block
arithmetic operations — + - * / **
trigonometric functions — sin()
, cos()
, tan()
, asin()
, acos()
, atan()
constants — pi, e, phi, sqrt(2), sqrt(1/2), infinity
tests — even, odd, prime, whole, positive, negative, divisible by
round — round()
, ceil()
, floor()
remainder — x % y
constrain number between values
random integer — custom function
random fraction — rand()
character
character tests — isAlpha
, isAlphaNumeric
, isAscii
, isControl
, isDigit
, isGraph
, isHexadecimalDigit
, isLowerCase
, isPrintable
, isPunct
, isSpace
, isUpperCase
, isWhitespace
length of string — String.length()
to upper/lower case — String.toUpperCase()
, String.toLowerCase()
string
concatenate strings
append string
in string find index of — String.indexOf()
, String.charAt()
trim string — String.trim()
in string replace substring — String.replace()
set serial bitrate — Serial.begin()
serial timeout for ms — Serial.setTimeout()
serial message — Serial.print()
, Serial.println()
serial byte — Serial.write()
serial data received — Serial.available() > 0
receive serial message — Serial.readString()
, Serial.readStringUntil()
receive serial byte — Serial.read()
receive serial message as number — Serial.parseFloat()
attach servo on pin
attach servo on pin (custom timing)
detach servo
set servo position
get servo position
add stepper motor (2 pins)
add stepper motor (4 pins)
set stepper speed
set stepper steps
attach L298N motor driver
set L298N motor driver direction
set L298N motor driver speed
state of pin — digitalRead()
set pin to — digitalWrite()
read analogue pin — analogRead()
set PWM pin to — analogWrite()
set board LED to — digitalWrite()
tone on pin to — tone()
stop tone on pin — noTone()
light sensor light/dark — custom function
light sensor value — analogRead()
sensor distance — custom function
potentiometer on pin — analogRead()
setup and loop — void setup()
and void loop()
reapeat num times — for
loop
repeat while — while
loop
skip to next loop cycle — continue
break out of loop — break
integer
float
boolean
string
set pin to mode — pinMode()
Advanced Mode
set analogue reference — analogReference()
Advanced Mode
duration of pulse on pin — pulseIn()
Advanced Mode
duration of long pulse on pin — pulseInLong()
Advanced Mode
shift incoming byte — shiftIn()
Advanced Mode
count with i from x to y by n — for
loop Advanced Mode
unsigned long Advanced Mode