Back to engineering archive

Record 081 / Firmware and control

Local-button indicator-control draft

An incomplete local-input draft with ordered button and float-input branches that primarily change indicator LEDs. It contains no BLE interface.

Incomplete archived draft
Local inputsIndicator controlEmbedded C++

Archived source flow

The local loop chooses the first LOW input in button1,button2,button3,button4,float priority. Active branches change indicators, with blocking shared-time waits for buttons2and3. A separate interrupt clears three indicators. No BLE or validated safety/relay operation is represented.
Selected active indicator branches from incomplete archived source. Shared-time waits can block polling; relay and solenoid operating actions are commented out. No safety behaviour is established. View diagram at full size

Technical notes

Local branch priority

The loop samples four buttons and a float input, then follows the first matching LOW branch. The first button changes LED1 only when the cached level changes; the later buttons drive indicator branches with blocking waits.

What the active code does

Button2 and Button3 compare millis() with a shared timestamp plus 5000 or 3000, then clear their indicators. These are not reliably button-relative delays. Button4, the float branch and InterruptFunction() clear three indicator LEDs.

Unfinished hardware logic

Relay and solenoid pins are initialized, while their intended operating actions are commented out. GPIO2 is configured first as an interrupt input and later as a solenoid output. A cached input value is also used as a pin number in one read. The source does not establish working BLE, emergency-stop or safe pump control.

Engineering archiveArchive record

Project enquiries

Discuss your project.

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

Discuss your project