Results for “Arduino / C”
Small, practical examples. Search by task or narrow things down below.
Print a label beside a number
Arduino / C: Combine Serial.print and Serial.println to put text and a value on one line.
Arduino / C✓ Tested
Read 16-bit values from a flash table
Arduino / C: pgm_read_word retrieves a complete word from program memory.
Arduino / C✓ Tested
Read a button in the Serial Monitor
Arduino / C: Use a pull-up input and if/else to report three button readings.
Arduino / C✓ Tested
Read a byte lookup table from flash
Arduino / C: PROGMEM tables require the AVR program-memory access functions.
Arduino / C✓ Tested
Read a fixed-size serial payload
Arduino / C: readBytes returns the number of bytes actually received.
Arduino / C✓ Tested
Read an integer from serial input
Arduino / C: parseInt skips leading nonnumeric characters and reads the next integer.
Arduino / C✓ Tested
Read an unpressed button with an internal pull-up
Arduino / C: An open input configured with INPUT_PULLUP reads high.
Arduino / C✓ Tested
Read and total a flash lookup table
Arduino / C: Array size can be computed at compile time even for a flash-resident table.
Arduino / C✓ Tested
Read serial text up to a delimiter
Arduino / C: readBytesUntil excludes the delimiter and does not add a null terminator.
Arduino / C✓ Tested
Repeat a serial message three times
Arduino / C: Repeat a serial message three times on an Uno with the Serial Monitor set to 9600 baud.
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