nerdshop / asinello-client

Client software of the asinello project
Apache License 2.0
1 stars 0 forks source link

LED ring abstraction and convenience #15

Open Oderik opened 3 years ago

Oderik commented 3 years ago

Ring abstraction

Abstract the LED ring and account for it's circularity (convenient modulo operations)

Encoder sampling

A common encoder snaps in on every fourth step. Use the other steps for smooth transitions when reflecting the encoder position on the ring.

Virtual effect resolution

Make number of LEDs that make up the ring configurable (at compile time or maybe even runtime).

Allow effects based on numbers more or less independent of the actual number of LEDs. For example, assuming we have 12 LEDs available:

Less entities than LEDs

If have 6 players and we want to make them selectable via the rotary encoder, distribute their lights evenly around the ring. Represent each player by one or two LEDs? In any case, use any intermediate LEDs for smooth transitions.

More entities than LEDs

If we have 16 players, use two or three LEDs for each player and indicate his virtual position within that segment via each LEDs brightness (and color).