Results for “serial line”
Small, practical examples. Search by task or narrow things down below.
Reject insertion when a fixed queue is full
Arduino / C: Track a count separately from circular read and write positions.
Arduino / C✓ Tested
Reject one outlier with a median-of-three filter
Arduino / C: Sorting three values leaves the median in the middle.
Arduino / C✓ Tested
Remove carriage-return characters
Linux Commands: Use tr -d to remove CR characters from Windows-style line endings.
Linux Commands✓ Tested
Repeat an action a fixed number of times
Use a counter and delay for a simple finite sequence.
for loop✓ Tested
Replace a token inside an Arduino String
Arduino / C: replace modifies all occurrences in the existing object.
Arduino / C✓ Tested
Replace text with sed
Replace all occurrences of the substring old on each line and print the transformed text without changing the input file.
sed✓ Tested
Represent a decimal quantity with a scaled integer
Arduino / C: Integer hundredths avoid floating-point storage for fixed-precision values.
Arduino / C✓ Tested
Represent an enabled state
Arduino / C: Represent an enabled state on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Require every bit in a mask
Arduino / C: Masking followed by equality tests whether all required flags are set.
Arduino / C✓ Tested
Reuse an LED action with a function
Arduino / C: Put a short LED sequence in a named function and call it twice.
Arduino / C✓ Tested
Run your first program
Python: Start with a complete program that prints one line. Follow the run instructions below.
Python✓ Tested
Run your first program
C#: Start with a complete program that prints one line. Follow the run instructions below.
C#✓ Tested