FIND YOUR NEXT FEW LINES

Results for “Serial”

Small, practical examples. Search by task or narrow things down below.

155 snippets foundClear filters
Arduino / CDigital signals & interrupts

Read back a configured digital output

Arduino / C: digitalRead observes the pin’s digital level after an output write.

Arduino / C✓ Tested
Arduino / CText & bounded buffers

Reject an integer with trailing characters

Arduino / C: strtol exposes an end pointer so a parser can require the entire token.

Arduino / C✓ Tested
Arduino / CEEPROM & program memory

Reject an unsupported settings version

Arduino / C: A version byte lets firmware fall back when stored settings use another format.

Arduino / C✓ Tested
Arduino / CArrays & embedded state

Reject insertion when a fixed queue is full

Arduino / C: Track a count separately from circular read and write positions.

Arduino / C✓ Tested
Arduino / CSensor calculations

Reject one outlier with a median-of-three filter

Arduino / C: Sorting three values leaves the median in the middle.

Arduino / C✓ Tested
Arduino / CTiming & control

Repeat an action a fixed number of times

Use a counter and delay for a simple finite sequence.

for loop✓ Tested
Arduino / CText & bounded buffers

Replace a token inside an Arduino String

Arduino / C: replace modifies all occurrences in the existing object.

Arduino / C✓ Tested
Arduino / CSensor calculations

Represent a decimal quantity with a scaled integer

Arduino / C: Integer hundredths avoid floating-point storage for fixed-precision values.

Arduino / C✓ Tested
Arduino / CGetting Started

Represent an enabled state

Arduino / C: Represent an enabled state on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
Arduino / CBinary values & packets

Require every bit in a mask

Arduino / C: Masking followed by equality tests whether all required flags are set.

Arduino / C✓ Tested
Arduino / CGetting Started

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
Arduino / CGetting Started

Select a response with switch

Arduino / C: Select a response with switch on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested