Skip to content

Instantly share code, notes, and snippets.

@Atarity
Created July 12, 2021 08:45
Show Gist options
  • Save Atarity/2ebe60e1cd742efdcf9ac2797b75d7fb to your computer and use it in GitHub Desktop.
Save Atarity/2ebe60e1cd742efdcf9ac2797b75d7fb to your computer and use it in GitHub Desktop.
Xiao-knob: Platformio can't see CCRotaryEncoder class
#include <Arduino.h>
#include <Control_Surface.h>
USBMIDI_Interface midi; // Instantiate a MIDI over USB interface
CCButton button {
8, // Push button on pin 8:
{MIDI_CC::General_Purpose_Controller_1, CHANNEL_1}, // General Purpose Controller #1 on MIDI channel 1
};
CCRotaryEncoder enc {
{3, 5}, // pins
MCU::V_POT_1, // MIDI address (CC number + optional channel)
1, // optional multiplier if the control isn't fast enough
};
void setup() {
pinMode(10, OUTPUT);
digitalWrite(10, LOW); // setting pin to GND
RelativeCCSender::setMode(relativeCCmode::MACKIE_CONTROL_RELATIVE);
Control_Surface.begin(); // Initialize Control Surface
}
void loop() {
Control_Surface.loop(); // Update the Control Surface
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment