Results for “Serial.read”
Small, practical examples. Search by task or narrow things down below.
Change visual order without changing DOM order
CSS: Order changes flex painting positions while keyboard and reading order still follow the document.
CSS✓ Tested
Check a literal prefix in C++17
C++: Use string compare because starts_with was introduced after C++17.
C++✓ Tested
Check a literal suffix in C++17
C++: Check lengths before subtracting to avoid an unsigned underflow.
C++✓ Tested
Check an upper integer bound before adding
C++: For these nonnegative values, compare against the maximum minus the addend first.
C++✓ Tested
Check available disk space
Show total, used, and available filesystem space for the current directory in human-readable units.
disk✓ Tested
Check both ends of a range
Arduino / C: Check both ends of a range on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Check EEPROM capacity before a write
Arduino / C: length reports the available address count for this board.
Arduino / C✓ Tested
Check memory usage
Show memory and swap totals in human-readable units. The available column estimates memory usable by new applications.
memory✓ Tested
Check that a file is present and nonempty
Test file content availability before reading it.
file check✓ Tested
Check whether a variable exists under nounset
Bash Scripts: The plus expansion distinguishes an unset variable without reading its missing value.
Bash Scripts✓ Tested
Choose between two branches
C++: Use if and else to handle an available or empty stock count.
C++✓ Tested
Choose the smaller of two values
Arduino / C: Choose the smaller of two values on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested