Results for “serial line”
Small, practical examples. Search by task or narrow things down below.
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
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
Debounce a button with a stable-time check
Accept an input change only after it stays stable for 30 ms.
debounce✓ Tested
Detect truncated formatted output
Arduino / C: snprintf returns the length it would have written, excluding the null terminator.
Arduino / C✓ Tested
Dispatch a command through function pointers
Arduino / C: A small function table can map validated command indices to actions.
Arduino / C✓ Tested
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
Encode a value as little-endian bytes
Arduino / C: Store the least significant byte first when the protocol requires it.
Arduino / C✓ Tested
Explain which ignore rule matches a file
Git: check-ignore -v reports the source file, line, pattern, and matched path.
Git✓ Tested
Extract a section of an Arduino String
Arduino / C: substring includes the start index and excludes the end index.
Arduino / C✓ Tested
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
Find a division remainder
Arduino / C: Find a division remainder on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Find a sample range in one pass
Arduino / C: Initialize extrema from the first element of a nonempty array.
Arduino / C✓ Tested