Open bobtorxx opened 4 years ago
You have to include the Encoder library first, please see the documentation and this example:
#include <Encoder.h> // Include the Encoder library.
// This must be done before the Control Surface library.
#include <Control_Surface.h> // Include the Control Surface library
There's also a stray period on this line:
CCRangeLEDsPWM<3> RGB = { . // RGB LED
^~~~
In your setup, you're calling both Control_Surface.begin()
and Serial.begin(115200)
. Control Surface will initialize your MIDI interface using Serial to MIDI_BAUD
, because that's what you specified on line 5, but then you override this by initializing the Serial port to a different baud rate yourself. It's best to specify the correct baud rate once on line 5, and get rid of the Serial.begin
in the setup.
Thanks for your fast response. Got it working :) So stupid of me I should knew that but I guess I have been staring at the screen for to long to see it. Now I got it working I see that wen I turn the encoder it doesn't increment. It jumps from a value of 1 and then immediate to 127. Instead of incrementing in steps (like the example with te potmeter). Thanks again
Yes, that's the intended behavior. CCRotaryEncoder sends relative messages. 127 represents a value of -1 in two's complement. You have to select a relative mode in your DAW, or use CCAbsoluteEncoder.
By the way, and hello, can CCAbsoluteEncoder be used within a bank? I did not see it in bankable list. And with a multiplexer CD74HC4067? Thank you
At the moment, this is not possible with the master
version, but you can use the share-encoder
branch: https://tttapa.github.io/Control-Surface-doc/share-encoder/Doxygen/d7/d2c/classBankable_1_1CCAbsoluteEncoder.html
You cannot use rotary encoders with multiplexers.
Ok thanks
Hallo Pieter,
First of all, this library and the work you put in to it is incredible! Its super awesome and its works fabulous! Through your examples and documentation I learned a lot about coding in Arduino. I had very little experience in coding en through this project of creating a midi controller I learned a lot so also thanks for that. At the moment I'm working on a controller. The idea is to have a bankable rotary encoder with a increment switch which scrolls through 3 banks. The 3 banks are connected with 3 leds (RGB) so that all the settings together get a colour.
I made it work with a potentiometer and a switch. However no matter what I try with example of the Encoder I don't seem to get it work. I get the error:
exit status 1 'CCRotaryEncoder' in namespace 'CS::Bankable' does not name a type"
What am I doing wrong or is it not possible?
I hope this is the right place to ask for such a question, it is the first time I post something on GitHub so excuse me if its the wrong formatting or place.
Thanks again! and greetings from Gijs