Results for “serial”
Small, practical examples. Search by task or narrow things down below.
Inspect a byte as hexadecimal
Arduino / C: Inspect a byte as hexadecimal on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Interpolate between two calibration points
Arduino / C: Compute a fractional position before scaling to the output interval.
Arduino / C✓ Tested
Keep a counter from wrapping at its maximum
Arduino / C: Increment only when the value is below its limit.
Arduino / C✓ Tested
Keep a value inside an allowed range
Arduino / C: Keep a value inside an allowed range on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Keep fixed text in flash memory
Arduino / C: Keep fixed text in flash memory on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Limit a value to a safe interval
Clamp an integer between chosen endpoints.
constrain✓ Tested
Maintain a rolling sum in a circular window
Arduino / C: Subtract the overwritten sample before adding the next one.
Arduino / C✓ Tested
Map an input range to an output range
Scale an integer reading to a different interval.
map✓ Tested
Measure a short delay with micros
Measure elapsed microseconds around a short operation.
micros✓ Tested
Measure UTF-8 bytes separately from characters
Java: Encode a Java string before measuring its serialized byte length.
Java✓ Tested
Name a fixed configuration value
Arduino / C: Name a fixed configuration value on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Pack two small values into one byte
Arduino / C: Mask each four-bit value before combining it.
Arduino / C✓ Tested