FIND YOUR NEXT FEW LINES
The snippet library.
Small, practical examples. Search by task or narrow things down below.
5 snippets foundClear filters
Average a fixed set of readings
Accumulate sample values without overflowing a 16-bit total.
array✓ Tested
Limit a value to a safe interval
Clamp an integer between chosen endpoints.
constrain✓ Tested
Map an input range to an output range
Scale an integer reading to a different interval.
map✓ Tested
Set and inspect a bit flag
Store several boolean states in one byte.
bitSet✓ Tested
Write and read a setting in EEPROM
Persist one byte using the update operation.
EEPROM✓ Tested