FIND YOUR NEXT FEW LINES

Results for “ring”

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

465 snippets foundClear filters
Arduino / CSensor calculations

Apply a linear sensor calibration

Arduino / C: Convert a raw reading using an offset and scale measured for the sensor.

Arduino / C✓ Tested
Arduino / CBinary values & packets

Assemble a big-endian 16-bit value

Arduino / C: Cast to an unsigned 16-bit type before shifting the high byte.

Arduino / C✓ Tested
Arduino / CBinary values & packets

Assign a bit from a Boolean state

Arduino / C: bitWrite accepts a bit position and a zero or nonzero value.

Arduino / C✓ Tested
Arduino / CData & storage

Average a fixed set of readings

Accumulate sample values without overflowing a 16-bit total.

array✓ Tested
Arduino / CDigital input & output

Blink the built-in LED three times

Alternate the built-in LED with a short blocking delay.

blink✓ Tested
Arduino / CTiming & control

Blink without blocking the loop

Use elapsed millis time instead of delay for a repeating action.

millis✓ Tested
Arduino / CGetting Started

Branch on a threshold

Arduino / C: Branch on a threshold on an Uno with the Serial Monitor set to 9600 baud.

Arduino / C✓ Tested
JavaText validation & formatting

Build text efficiently in a loop

Java: Append to StringBuilder when constructing a string incrementally.

Java✓ Tested
Arduino / CBinary values & packets

Calculate a CRC-8 over a byte sequence

Arduino / C: This implementation uses polynomial 0x07, initial zero, and no reflection.

Arduino / C✓ Tested
SQLWindow analytics

Calculate a cumulative integer percentage

SQL: Divide a running window sum by the complete total using a unique ordering key.

SQL✓ Tested
SQL ServerWindow analytics

Calculate a cumulative integer percentage

SQL Server: Divide a running window sum by the complete total using a unique ordering key.

SQL Server✓ Tested
PostgresWindow analytics

Calculate a cumulative integer percentage

Postgres: Divide a running window sum by the complete total using a unique ordering key.

Postgres✓ Tested