tttapa/Control-Surface not compiling on Nano Every

Hello, me again.

So , I was using some knock-off nano boards to make MIDI controllers with Pieter P's STILL fabulous Control Surface Library, and everything was great.
BUT- I fried a couple of them by sending 12 or 13 V.
So, I did some reading, and I got a few of these official, name-brand NANO EVERY boards, because they apparently are more voltage tolerant, and I saw in some of the docs for Control_Surface that the NANO-EVERY was tested.

But it wont compile.

I can compile basic example sketches just fine, but when I #include <Control_Surface.h>, it fails.
The log starts with this WARNING,:

WARNING: library Control-Surface-master claims to run on avr, sam, samd, teensy, esp32 architecture(s) and may be incompatible with your current board which runs on megaavr architecture(s)

Followed by many repetitions of this error:

In file included from D:\MY DOCS\Arduino\libraries\Control-Surface-master\src\AH\Math\Vector.cpp:1:0:

D:\MY DOCS\Arduino\libraries\Control-Surface-master\src\AH\Math\Vector.hpp:262:1: error: reference to 'Print' is ambiguous

Print &operator<<(Print &os, Vec2f v);

^~~~~

D:\MY DOCS\Arduino\libraries\Control-Surface-master\src\AH\Math\Vector.hpp:12:7: note: candidates are: class Print

class Print;

^~~~~
>SNIPPED MANY EXAMPLES OF THE SAME<

exit status 1
Error compiling for board Arduino Nano Every.

I tried adding megaavr to the Library.Properties file.. which avoids the warning, but the errors remain.
I have tried compiling under ATMEGA4809 and the emulator for 328, no change.
I can't seem to find a solution for googles.

So I come to you with the question:
Is this something I can fix? Or should I re-write under a different library?

Thank you for your time,
cameron

The library.properties is just an indication, it doesn't affect the compilation process.

For my unit tests, I use the megAVR core version 1.8.5, and it seems to compile correctly (I don't own a Nano Every, so I can't test it).

For now, you can just select version 1.8.5 in the Boards Manager in the Arduino IDE. I'll look into the problem later today or tomorrow.

Pieter

Hello!

I just tried switching to 1.8.5, but I just got different errors!

Instead of the 'print' thing every second it was a lot of this:
#error "Interrupts are unknown for this board, please add to this code"
#error "Encoder requires interrupt pins, but this board does not have any :("
#error "You could try defining ENCODER_DO_NOT_USE_INTERRUPTS as a kludge."

Please let me know if I simply cant use a megaAVR board. I can adjust. But I do love your library, and I know how to work with it, which is good for a hack like myself.

Thank you for your time, again!

cameron206:
Instead of the 'print' thing every second it was a lot of this:
#error "Interrupts are unknown for this board, please add to this code"
#error "Encoder requires interrupt pins, but this board does not have any :("
#error "You could try defining ENCODER_DO_NOT_USE_INTERRUPTS as a kludge."

This is a problem with the Encoder library, not of Control Surface directly.

The Nano Every should be supported in the latest version of that library, so you should probably upgrade it:

Whoa you are right.
This is a clean IDE, and that library is up to date.
But it's examples also fail to compile.

I am going to dig into this.

The version in the library manager of the IDE might not be up to date. You can install it from GitHub directly, just to be sure. Be sure to uninstall the library manager version first.

Goodness that was the ticket. I think.

I re-reinstalled my IDE, used the manual .encoder library, and ran 1.8.5... and it compiles!

Notably, it still fails under 1.8.6

Thank you again for your help with everything, you make so much possible in our little corner of the universe.

It should be fixed in the latest master version (currently c377318).

I've also updated the CI to use the latest version of the Arduino megaAVR Core.

All I've tested is whether it compiles or not, and whether the mocked unit tests succeed. I don't have any megaAVR boards to test if it runs correctly on-target (though I don't expect any issues, it works fine on many other boards).

If you could let me know whether it works or not, that'd be great.

Thanks for letting me know about the issue.

Hey!

It totally works perfect on 1.8.6 now.

You are brilliant.

Also, here is a total tutorial of my latest MIDI controller using your library. Fun times!

Nice! Thanks for sharing!