Results for “CTE”
Small, practical examples. Search by task or narrow things down below.
Compare elapsed time across timer rollover
Use unsigned subtraction when a millisecond counter wraps.
rollover✓ Tested
Compare floating-point calculations with tolerance
Python: Use isclose instead of exact equality for results affected by floating-point rounding.
Python✓ Tested
Constrain and center a container
Use max-width and auto margins for a centered CSS reading area.
CSS✓ Tested
Control an LED from a button
Translate an active-low button input into an LED output.
button✓ Tested
Convert a string to lowercase
Normalize a text value using Bash expansion.
lowercase✓ Tested
Convert a supplied ADC count to volts
Arduino / C: Scale a ten-bit ADC count using an explicit reference voltage.
Arduino / C✓ Tested
Convert a variable to uppercase
Bash Scripts: Double caret transforms matching lowercase characters in Bash 4 or later.
Bash Scripts✓ Tested
Convert ASCII text to uppercase
Convert characters with toupper while avoiding signed-char undefined behavior.
C✓ Tested
Convert Celsius to Fahrenheit
Arduino / C: Use floating-point constants to avoid integer division.
Arduino / C✓ Tested
Convert received ASCII letters to uppercase
Arduino / C: ctype functions should receive an unsigned character value.
Arduino / C✓ Tested
Copy a file to a chosen destination
PowerShell: LiteralPath prevents wildcard characters in the source filename from being interpreted.
PowerShell✓ Tested
Copy a flash string into a bounded RAM buffer
Arduino / C: strncpy_P reads from program memory into ordinary RAM.
Arduino / C✓ Tested