Back to engineering archive

Record 002 / Firmware and control

Potentiometer, encoder and button MIDI draft

A potentiometer, polled quadrature encoder and two buttons produce MIDI control-change and note events in this archived application draft.

Archived firmware draft
MIDIPotentiometerEncoderButton input

Archived source flow

Archived MIDI main loop: send a mapped potentiometer CC7 each loop; on encoder A changes send CC44 value1or127 based on B; detect two button changes and emit note-on/off flags. No keypad or debounce layer is present, and no MIDI hardware test is established.
Main-loop paths reconstructed from archived application source. Input debounce, a board build and MIDI hardware operation are unverified. View diagram at full size

Technical notes

Potentiometer control

Every loop maps the expected 0–1023 analog input range to 0–127 and sends CC7. The source does not suppress unchanged potentiometer values.

Encoder and buttons

A change on encoder channel A selects CC44 value 1 or 127 according to channel B, then saves A. Changes on two button inputs set press/release flags that produce note-on/off events for notes 60 and 61.

Source limits

The source polls inputs without a debounce layer or analog filtering. Cached button states start low and may produce initial release messages. Nano is the target named in the portfolio index; the file does not provide a board build configuration. Compilation and MIDI 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