FIND YOUR NEXT FEW LINES

Results for “du”

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

410 snippets foundClear filters
Arduino / CGetting Started

Count down with a bounded loop

Arduino / C: Count down with a bounded loop on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
Arduino / CGetting Started

Count five LED flashes with a for loop

Arduino / C: Repeat an LED action a known number of times and print the current count.

Arduino / C✓ Tested
Arduino / CText & bounded buffers

Detect truncated formatted output

Arduino / C: snprintf returns the length it would have written, excluding the null terminator.

Arduino / C✓ Tested
Arduino / CArrays & embedded state

Dispatch a command through function pointers

Arduino / C: A small function table can map validated command indices to actions.

Arduino / C✓ Tested
Arduino / CSerial protocols

Dispatch a one-character serial command

Arduino / C: A switch provides explicit handling for accepted and unknown commands.

Arduino / C✓ Tested
Arduino / CDigital signals & interrupts

Drive the built-in LED low after turning it on

Arduino / C: digitalWrite changes the actual output level of a configured pin.

Arduino / C✓ Tested
Arduino / CBinary values & packets

Encode a value as little-endian bytes

Arduino / C: Store the least significant byte first when the protocol requires it.

Arduino / C✓ Tested
Arduino / CGetting Started

Explain a sketch with comments

Arduino / C: Use single-line and block comments to document what a sketch does.

Arduino / C✓ Tested
Arduino / CBinary values & packets

Extract the low and high byte of a value

Arduino / C: lowByte and highByte expose the two bytes of a 16-bit value.

Arduino / C✓ Tested
Arduino / CGetting Started

Find a division remainder

Arduino / C: Find a division remainder on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
Arduino / CArrays & embedded state

Find a sample range in one pass

Arduino / C: Initialize extrema from the first element of a nonempty array.

Arduino / C✓ Tested
Arduino / CArrays & embedded state

Find a value in a small lookup table

Arduino / C: A linear scan is simple and predictable for a small fixed array.

Arduino / C✓ Tested