FIND YOUR NEXT FEW LINES

Results for “Serial.read”

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

591 snippets foundClear filters
C++Getting Started

Find what remains after division

C++: Use the remainder operator to count items left after forming complete groups.

C++✓ Tested
C++Numeric parsing & calculations

Format an integer into a caller-owned buffer

C++: to_chars avoids allocation and reports whether the buffer was large enough.

C++✓ Tested
Arduino / CText & bounded buffers

Format several integers in a fixed buffer

Arduino / C: snprintf limits writes to the buffer size and includes a terminating null byte.

Arduino / C✓ Tested
Arduino / CDigital signals & interrupts

Generate and measure a short output pulse

Arduino / C: delayMicroseconds can create a short blocking pulse on an output pin.

Arduino / C✓ Tested
Arduino / CGetting Started

Give an LED pin a constant name

Arduino / C: Use const to name the built-in LED pin and reuse it in output instructions.

Arduino / C✓ Tested
C++Ordering & set operations

Group matching values while preserving their order

C++: stable_partition keeps the relative order within both predicate groups.

C++✓ Tested
C++Filesystem operations

Handle a failed file open through stream state

C++: An unopened input stream is not an empty successful file read.

C++✓ Tested
C++Numeric parsing & calculations

Handle a failed string-to-integer conversion

C++: stoi throws invalid_argument when no conversion can be performed.

C++✓ Tested
C++Getting Started

Handle three possible outcomes

C++: Check high, normal and low values with an ordered conditional chain.

C++✓ Tested
Arduino / CGetting Started

Hello World: Blink

Arduino / C: Blink the built-in LED slowly and then quickly, repeating both rates in loop().

Arduino / C✓ Tested
GitWorking tree & staging

Ignore generated files

Exclude build output from untracked-file listings.

gitignore✓ Tested
Arduino / CSensor calculations

Ignore small movements around a center value

Arduino / C: Values inside the deadband become zero while others keep their direction.

Arduino / C✓ Tested