Results for “Serial.read”
Small, practical examples. Search by task or narrow things down below.
Join strings with a separator
Combine a list of strings into one readable string with a separator between each item.
string✓ Tested
Keep a counter from wrapping at its maximum
Arduino / C: Increment only when the value is below its limit.
Arduino / C✓ Tested
Keep a value inside an allowed range
Arduino / C: Keep a value inside an allowed range on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Keep fixed text in flash memory
Arduino / C: Keep fixed text in flash memory on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Label rows with CASE
Derive a readable label from a condition.
CASE✓ Tested
Limit a value to a safe interval
Clamp an integer between chosen endpoints.
constrain✓ Tested
List files tracked by Git
Git: ls-files reads the index instead of listing every file in the working directory.
Git✓ Tested
List regular files recursively in sorted order
C++: Collect relative paths before sorting because directory iteration order is unspecified.
C++✓ Tested
List the paths with unresolved merge conflicts
Git: The U diff filter identifies unmerged entries without parsing human-readable status output.
Git✓ Tested
Load a small properties configuration
Java: Use a Reader to make the configuration character encoding explicit.
Java✓ Tested
Look up a map key
Use find to read a C++ map without inserting a missing key.
C++✓ Tested
Maintain a rolling sum in a circular window
Arduino / C: Subtract the overwritten sample before adding the next one.
Arduino / C✓ Tested