FIND YOUR NEXT FEW LINES

Results for “Serial”

Small, practical examples. Search by task or narrow things down below.

155 snippets foundClear filters
Arduino / CGetting Started

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
Arduino / CSensor calculations

Interpolate between two calibration points

Arduino / C: Compute a fractional position before scaling to the output interval.

Arduino / C✓ Tested
Arduino / CArrays & embedded state

Keep a counter from wrapping at its maximum

Arduino / C: Increment only when the value is below its limit.

Arduino / C✓ Tested
Arduino / CGetting Started

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
Arduino / CGetting Started

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
Arduino / CData & storage

Limit a value to a safe interval

Clamp an integer between chosen endpoints.

constrain✓ Tested
Arduino / CSensor calculations

Maintain a rolling sum in a circular window

Arduino / C: Subtract the overwritten sample before adding the next one.

Arduino / C✓ Tested
Arduino / CData & storage

Map an input range to an output range

Scale an integer reading to a different interval.

map✓ Tested
Arduino / CTiming & control

Measure a short delay with micros

Measure elapsed microseconds around a short operation.

micros✓ Tested
JavaEncoding & structured values

Measure UTF-8 bytes separately from characters

Java: Encode a Java string before measuring its serialized byte length.

Java✓ Tested
Arduino / CGetting Started

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
Arduino / CBinary values & packets

Pack two small values into one byte

Arduino / C: Mask each four-bit value before combining it.

Arduino / C✓ Tested