Results for “target”
Small, practical examples. Search by task or narrow things down below.
Blink the built-in LED three times
Alternate the built-in LED with a short blocking delay.
blink✓ Tested
Blink without blocking the loop
Use elapsed millis time instead of delay for a repeating action.
millis✓ Tested
Branch on a threshold
Arduino / C: Branch on a threshold on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Build a URL query string from values
TypeScript: URLSearchParams handles query escaping and repeated parameter appends.
TypeScript✓ Tested
Build an object from key-value entries
TypeScript: Object.fromEntries converts an iterable of pairs into ordinary own properties.
TypeScript✓ Tested
Calculate a CRC-8 over a byte sequence
Arduino / C: This implementation uses polynomial 0x07, initial zero, and no reflection.
Arduino / C✓ Tested
Calculate a fixed array’s element count
Arduino / C: Calculate a fixed array’s element count on an Uno with the Serial Monitor set to 9600 baud.
Arduino / C✓ Tested
Calculate a page count with ceiling division
TypeScript: Use Math.ceil for a nonnegative item count and a positive page size.
TypeScript✓ Tested
Calculate a simple packet XOR checksum
Arduino / C: XOR all payload bytes to produce a basic error-detection byte.
Arduino / C✓ Tested
Calculate a simple total
TypeScript: Multiply a unit price by a quantity, then add a delivery fee.
TypeScript✓ Tested
Calculate differences between adjacent readings
TypeScript: Slice off the first value and compare each remaining value with its predecessor.
TypeScript✓ Tested
Calculate integers beyond Number’s precise range
TypeScript: Use BigInt operands together to avoid precision loss.
TypeScript✓ Tested