cs-midi-docs/docs/examples/01-output/20-cc-potentiometers.md

644 B

Multiple CCPotentiometers

Several analog inputs mapped to CC on different channels.

Original: Multiple-Control-Change-Potentiometers.ino

#include "pico/stdlib.h"
#include "pico/cyw43_arch.h"
#include <cs_midi.h>

using namespace cs;

BluetoothMIDI_Interface midi;

CCPotentiometer pots[] {
    {26, {MIDI_CC::Channel_Volume, Channel_1}},
    {27, {MIDI_CC::Channel_Volume, Channel_2}},
    {28, {MIDI_CC::Channel_Volume, Channel_3}},
};

int main() {
    stdio_init_all();
    if (cyw43_arch_init()) return 1;
    Control_Surface.begin();
    while (true) {
        Control_Surface.loop();
        sleep_ms(1);
    }
}