Results for “z”
Small, practical examples. Search by task or narrow things down below.
Copy a string with a guaranteed terminator
Arduino / C: Reserve one character for the terminator when copying a bounded string.
Arduino / C✓ Tested
Count a button’s falling edge in the main loop
Arduino / C: Compare each reading with the previous state to detect transitions.
Arduino / C✓ Tested
Count a falling edge with an interrupt
Increment a counter when an external input changes.
attachInterrupt✓ Tested
Count a rising edge with an interrupt
Arduino / C: RISING triggers when the input changes from low to high.
Arduino / C✓ Tested
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
Count repeated lines after sorting
Linux Commands: Group identical lines before uniq -c, then normalize its leading padding.
Linux Commands✓ Tested
Count words using a Map
Update a keyed counter without losing its value type.
Map✓ Tested
Create a compressed tar archive
Bundle a directory into a gzip-compressed tar archive, preserving the directory structure.
tar✓ 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