Results for “Serial.read”
Small, practical examples. Search by task or narrow things down below.
Copy a file without replacing an existing destination
Java: Files.copy fails if the destination already exists unless replacement is explicitly enabled.
Java✓ Tested
Copy a file without replacing an existing destination
C++: The default copy_file policy refuses to overwrite an existing destination.
C++✓ Tested
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 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 elements satisfying a predicate
C++: count_if counts matches without constructing a filtered collection.
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 occurrences in a sorted sequence
C++: equal_range finds the half-open interval containing values equal to the key.
C++✓ Tested
Count the items in a collection
Python: Read the collection’s length instead of hard-coding the loop limit.
Python✓ Tested
Count the items in a collection
C#: Read the collection’s length instead of hard-coding the loop limit.
C#✓ Tested
Count the items in a collection
Java: Read the collection’s length instead of hard-coding the loop limit.
Java✓ Tested
Count the items in a collection
JavaScript: Read the collection’s length instead of hard-coding the loop limit.
JavaScript✓ Tested