FIND YOUR NEXT FEW LINES

Results for “Serial.read”

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

591 snippets foundClear filters
CSSType & reading flow

Style supporting text in italics

CSS: Font-style changes presentation without adding semantic emphasis by itself.

CSS✓ Tested
RustThreads & shared ownership

Update an atomic counter

Update an atomic counter in a complete Rust program using the standard library.

Rust✓ Tested
C++Containers & compound values

Add and remove values at both ends

C++: Deque supports efficient end operations without requiring contiguous storage.

C++✓ Tested
Arduino / CArrays & embedded state

Advance an index around a fixed collection

Arduino / C: Modulo wraps a bounded nonnegative index to zero.

Arduino / C✓ Tested
C++Ownership & optional values

Apply an operation to a variant’s active value

C++: A generic visitor lets the compiler check behavior for every possible alternative.

C++✓ Tested
Arduino / CBinary values & packets

Assemble a big-endian 16-bit value

Arduino / C: Cast to an unsigned 16-bit type before shifting the high byte.

Arduino / C✓ Tested
Arduino / CBinary values & packets

Assign a bit from a Boolean state

Arduino / C: bitWrite accepts a bit position and a zero or nonzero value.

Arduino / C✓ Tested
Arduino / CDigital input & output

Blink the built-in LED three times

Alternate the built-in LED with a short blocking delay.

blink✓ Tested
Arduino / CTiming & control

Blink without blocking the loop

Use elapsed millis time instead of delay for a repeating action.

millis✓ Tested
Arduino / CGetting Started

Branch on a threshold

Arduino / C: Branch on a threshold on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
C++Containers & compound values

Build a minimum-priority queue

C++: Supply greater as the comparator because priority_queue defaults to the largest value first.

C++✓ Tested
Arduino / CBinary values & packets

Calculate a CRC-8 over a byte sequence

Arduino / C: This implementation uses polynomial 0x07, initial zero, and no reflection.

Arduino / C✓ Tested