FIND YOUR NEXT FEW LINES

Results for “digit”

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

29 snippets foundClear filters
Arduino / CDigital signals & interrupts

Read an unpressed button with an internal pull-up

Arduino / C: An open input configured with INPUT_PULLUP reads high.

Arduino / C✓ Tested
Arduino / CDigital signals & interrupts

Stop receiving interrupts when a task finishes

Arduino / C: detachInterrupt removes the registered callback.

Arduino / C✓ Tested
Arduino / CDigital signals & interrupts

Toggle an output using an explicit software state

Arduino / C: Keep the intended output state in a Boolean variable.

Arduino / C✓ Tested
Arduino / CDigital input & output

Turn on the built-in LED

Configure the Uno’s LED pin as an output and drive it high.

LED_BUILTIN✓ 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 / CDigital input & output

Control an LED from a button

Translate an active-low button input into an LED output.

button✓ Tested
Arduino / CDigital input & output

Count a falling edge with an interrupt

Increment a counter when an external input changes.

attachInterrupt✓ Tested
CBinary formats & structured parsing

Encode a byte buffer as hexadecimal

C: Format each byte as an unsigned two-digit hexadecimal value.

C✓ Tested
PythonStrings & dates

Extract numbers from text

Find all runs of ASCII digits in a string and convert the matches to integers.

regex✓ Tested
JavaNumbers & dates

Format a decimal number

Format a Java decimal with two digits and a fixed locale.

Java✓ Tested
CNumbers & memory

Format a decimal value

Print two fractional digits with C printf.

C✓ Tested
CBinary formats & structured parsing

Format a nonnegative integer amount as whole and fractional units

C: Keep the calculation in integer minor units and use two digits for the remainder.

C✓ Tested