Repository navigation
feat(hardware): M5Stack 8Angle potentiometer board - #249
Merged
Merged
Conversation
Pots 1-5 set the knob strip's parameters once they reach their value (pickup), pot 6 picks the page, the switch turns the block shown on or off, and the LEDs show which pots drive their parameter. Closes #248
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #248
Adds the M5Stack Unit 8Angle (8 pots, a toggle switch, 9 RGB LEDs, I2C 0x43) as a board in Settings → Hardware. Other boards, and setups without a board, work as before; old
hardware.jsonfiles load unchanged (the new board is saved asm5-stack8-angle).What the pots do
Pickup
A pot only takes a parameter over once it reaches the parameter's value: it crosses it, comes within 2 % of it, or already selects the same option / switch side. Until then, moving it does nothing. A pot lets go again when another parameter comes under it (page or block change) or when the value is changed from elsewhere (touch, MIDI, preset, scene, remote). So nothing ever jumps.
LEDs
The UI is asked for the colours every 100 ms, and LEDs are written at most every 50 ms and only when they change. They are turned off when the board is let go.
Reading the pots
12-bit readings, smoothed, with a deadband of about 0.5 % and snapping at both ends: a pot left alone sends nothing, and both ends are reachable. Polled every 10 ms like the other boards. "Steps per detent" is hidden for this board; "Reverse" flips the pots' direction.
Register layout from M5Stack's M5Unit-8Angle library and its I2C protocol sheet: 0x00–0x0F 12-bit ADC (little endian), 0x20 switch, 0x30 + 4 × n LEDs as R, G, B, brightness 0–100 (LED 8 is the switch's), 0xFE firmware. If an 8Encoder is chosen but an 8Angle answers (or the other way round), the error says which board to pick.
Tests
Simulated bus: the scan finds 0x43; still pots send nothing and moves send their position; reverse; switch moves; LEDs written only on change and rate-limited. Pickup: nothing until crossing, then follows; page change and outside changes re-arm it; list and switch mapping; page pot. Old and new
hardware.jsonfiles load.