33 lines
610 B
Markdown
33 lines
610 B
Markdown
# CCAbsoluteEncoder
|
|
|
|
Encoder position mapped to absolute CC value.
|
|
|
|
> Original: `AbsoluteRotaryEncoder.ino`
|
|
|
|
```cpp
|
|
#include "pico/stdlib.h"
|
|
#include "pico/cyw43_arch.h"
|
|
#include <cs_midi.h>
|
|
|
|
using namespace cs;
|
|
|
|
BluetoothMIDI_Interface midi;
|
|
|
|
CCAbsoluteEncoder enc {
|
|
{0, 2}, // encoder pins
|
|
MIDI_CC::Pan, // CC address
|
|
1, // speed multiplier
|
|
4, // pulses per step
|
|
};
|
|
|
|
int main() {
|
|
stdio_init_all();
|
|
if (cyw43_arch_init()) return 1;
|
|
Control_Surface.begin();
|
|
while (true) {
|
|
Control_Surface.loop();
|
|
sleep_ms(1);
|
|
}
|
|
}
|
|
```
|