FIND YOUR NEXT FEW LINES

Results for “Serial protocols”

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

175 snippets foundClear filters
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
Arduino / CDigital signals & interrupts

Play a fixed digital output pattern

Arduino / C: A pattern table separates the output sequence from its timing.

Arduino / C✓ Tested
Arduino / CGetting Started

Preserve a fractional result

Arduino / C: Preserve a fractional result on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
Arduino / CSensor calculations

Prevent output chatter with separate thresholds

Arduino / C: Use different on and off thresholds to retain state between them.

Arduino / C✓ Tested
Arduino / CGetting Started

Print a fixed text buffer

Arduino / C: Print a fixed text buffer on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested