Back to engineering archive

Record 062 / Lighting and interaction

Three-position WS2812 colour-selector draft

An Arduino Nano-targeted draft maps a three-position switch to static yellow, off or blue output through the NeoPixel API. The archived configuration controls one LED.

Archived firmware draft
Arduino Nano targetWS2812BSwitch inputNeoPixel API

Archived source flow

Archived Nano-targeted switch draft. Read two active-low inputs and resolve yellow,blue or off. Accept a changed mode only when more than25ms have elapsed since the last accepted change, then update the static output. Both-active and neither-active map to off. No animation or stable-state debounce is implemented.
Switch-mode logic reconstructed from archived source. The file is configured for one LED; compilation, upload and hardware operation are unverified. View diagram at full size

Technical notes

Switch mapping

With pull-up inputs, only the up throw active selects yellow and only the down throw active selects blue. Both active or both inactive resolve to off.

Mode-change gate

A new mode is accepted only after more than 25 ms have passed since the previous accepted change. This limits the rate of accepted changes; it does not require the input to remain stable for 25 ms.

Static output

setAll() writes one selected colour to the configured pixels and calls show(); off clears the strip and shows the cleared buffer. The stored LED_COUNT is 1 and must be configured for the intended strip. There are no animation sequences in this source.

Evidence limits

The source header and original IDE view identify the Nano target and NeoPixel setup. The IDE view has no discovered port; compilation, upload and hardware operation are unverified.

Engineering archiveArchive record

Project enquiries

Discuss your project.

Tell us what you’re developing and where you need engineering support.

Discuss your project