FIND YOUR NEXT FEW LINES

Results for “Serial”

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

155 snippets foundClear filters
Arduino / CBinary values & packets

Toggle a bit with an XOR mask

Arduino / C: XOR flips selected bits and leaves all other bits unchanged.

Arduino / C✓ Tested
Arduino / CDigital signals & interrupts

Toggle an output using an explicit software state

Arduino / C: Keep the intended output state in a Boolean variable.

Arduino / C✓ Tested
Arduino / CText & bounded buffers

Trim surrounding whitespace from an Arduino String

Arduino / C: String.trim modifies the object in place.

Arduino / C✓ Tested
Arduino / CDigital input & output

Turn on the built-in LED

Configure the Uno’s LED pin as an output and drive it high.

LED_BUILTIN✓ Tested
Arduino / CGetting Started

Understand setup() and loop()

Arduino / C: See initialization run once and the main loop run repeatedly.

Arduino / C✓ Tested
C#JSON & binary formats

Update a JSON document with mutable nodes

C#: JsonNode permits targeted changes before serializing a document again.

C#✓ Tested
Arduino / CGetting Started

Use a wider type for a large count

Arduino / C: Use a wider type for a large count on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
Arduino / CArrays & embedded state

Use named states for a controller

Arduino / C: An enum makes state transitions easier to read than unexplained numbers.

Arduino / C✓ Tested
Arduino / CEEPROM & program memory

Validate a small stored payload with a checksum

Arduino / C: Store a checksum with the payload and reject a changed byte.

Arduino / C✓ Tested
Arduino / CGetting Started

Visit every reading in a fixed array

Arduino / C: Visit every reading in a fixed array on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
Arduino / CData & storage

Write and read a setting in EEPROM

Persist one byte using the update operation.

EEPROM✓ Tested