I also already wrote some code to test all the controls.
With my arduino-uno the recognition of the board itself works fine.
I can see the switches and encoders at the assignment screen, but very often the board disconnects
when I want to save the assignment. Also when i first assign the footswitch, and then the encoder, often only
the encoder works. The LED still toggles, but the board and gui doesn’t react to the sent value.
I also thought about switching to my arduino due, to be able to use the second encoder and the display properly, but when I flash the code onto the due, it doesn’t get recognized ever.
The other short examples don’t work either.
The due itself works as I’m able to write something to the display and toggle the LEDs.
I have also connected 2 LEDs to the Rxd and Txd pins, and was able to activate them via digitalWrite, so i think they work too.
Do I have to do some additional things to make the ControlChain things work on the due?
If anyone is interested in my project you can find all the files here:
I see you are using the last released Control Chain library. I’ve done some changes in that version so the library uses the UART interrupt instead of the serialEvent function provided by the Arduino. The reason I did this is exactly to avoid the disconnections. When I have the chance I’ll try out your code here to check if I find any still issue regarding the UART.
The support for the Due is temporarily disabled because the Arduino ARM core doesn’t allows to redefine the interrupts so I cannot control the UART interruption by myself. I’ve created a pull request to Arduino code resolving this issue. It is now 2+ years old: https://github.com/arduino/Arduino/pull/3023. Once they merge the PR we can have Due working with the Control Chain library.
Thank you a lot for your nice words. I’m happy that you like it.
When I’ve finished the software part too, I plan on making this a tutorial
with all the parts, electronics, 3D-files etc. So anyone who is interested can
copy it, or use it as a basis for his own project.
Thank you for your fast reply!
Ok, seems like I have to wait a little longer to use the callback-strings.
If I would apply this changes locally on my pc, would it be possible to use the
due now? If yes, do I need to set anything else to enable the due?
I have another question regarding the arduino uno.
Is there a reason why the uno only supports 4 actuators?
Would it be possible to set the maximum to 5, to be able to use the second encoder?
Maybe it would be a good idea to state which arduinos are supported in the
library or the wiki, so no one is dissapointed if the project doesn’t work out as planed
or buys an unnecessary board.
would it require changes in the control chain library to implement that sort of thing, or is it possible to write code to utilize those analog inputs with the existing library? unfortunately, i don’t yet know enough about the programming involved… but i’m trying to learn!
I haven’t looked much at the control chain stuff, all the bits I got are still sitting in the “when I have some time” box, but most Arduino type things have ADC stuff there ready to use without buying anything.
For instance the Arduino Uno has 6 channels of 10 bit ADC, so that would support 6 pedals/knobs each with 1024 discrete values which I guess is fine?
Jup, depends on what you want to do, but normal potentiometers and other analog inputs work out of the box with the uno. But keep in mind, that the total amount of actuators you can use with the control chain are capt to 4 pices.
When the due is supported, up to 8 actuators are possible.
Yes, that is possible. I’m editing the README file to add this information, but to put you ahead what you need
is to edit the file: variants/arduino_due_x/variant.cpp. It should be in the Arduino’s installation path which depends on the OS you have.
My case (Linux) is:
There is no other reason but to save space for the user application. You can tweak these values according your application. Open the config.h file (inside the ControlChain library folder) and change the define CC_MAX_ACTUATORS to the value that fits you better. Unfortunately this is not the ideal way to do it (that’s why it’s not documented) because every time you update the library you need to redo the configuration.
In the future I hope to be possible to move the config file to the user project instead of the library one.
Thanks for the feedback. I’m adding this info to the README file.
right… understood! i was just looking at a possible way to increase the number of available controllers (i was especially concerned with the 4 actuator CC-lib cap!), and ran across that 8-channel I2C device… it got me dreaming about possibilities!
so, in theory i could just change the CC_MAX_ACTUATORS define to include the extra inputs on the !2C ADC, and then it’s just a question of figuring out how to get that data to the CC-libs, and whether there’s still enough memory to hold all the required programming, right?
Thank you again for your reply.
Alright, I already found the defines in the config.h, but wasn’t sure if its a good
idea to change the values in there. With the second encoder available I can do
the most importend things for the first software iteration.
I also managed to include your changes into due_x variant.cpp, but the due still never connects to
the MOD GUI. I tried it with the tutorial codes, and my code.
Anything else I need to do, or do you maybe have a good idea how i can check if data gets sent to the MOD? Maybe a flag or anything i need to set?
I used the verbose compilation mode to check if i got the right file for the changes. So I’m sure i got the right one.