sparkfun / SparkFun_Alphanumeric_Display_Arduino_Library

Arduino Library for the SparkX Qwiic Alphanumeric Display
Other
22 stars 13 forks source link

not running, but successfully compiles on Arduino Nano Every (ATMega4809) #18

Closed bethanysciences closed 1 year ago

bethanysciences commented 1 year ago

Subject of the issue

not running, but successfully compiles on Arduino Nano Every (ATMega4809).

Workbench

MCU: Arduino Nano Every (ATMega4809) Compiling on Arduino version: 2.1.1 2023-07-03T07:51:40.946Z CLI Version: 0.32.3 Board version Arduino MegaAVR Boards version 1.8.8 tested 4 different displays w/ same result connected with stemma connectors.

Steps to reproduce

Compiles and loads successfully but does have this message:

In file included from ...Arduino/libraries/Alphanumeric_Display/src/SparkFun_Alphanumeric_Display.h:28:0,
                 from ...Arduino/libraries/Alphanumeric_Display/src/SparkFun_Alphanumeric_Display.cpp:32:
             ...Library/Arduino15/packages/arduino/hardware/megaavr/1.8.8/libraries/Wire/src/Wire.h: In member function 'bool HT16K33::readRAM(uint8_t, uint8_t, uint8_t*, uint8_t)':
...Library/Arduino15/packages/arduino/hardware/megaavr/1.8.8/libraries/Wire/src/Wire.h:63:12: note: candidate 1: size_t TwoWire::requestFrom(int, int)
     size_t requestFrom(int, int);
            ^~~~~~~~~~~
...Library/Arduino15/packages/arduino/hardware/megaavr/1.8.8/libraries/Wire/src/Wire.h:61:12: note: candidate 2: virtual size_t TwoWire::requestFrom(uint8_t, size_t)
     size_t requestFrom(uint8_t, size_t);

All segments light regardless of fed signals

Solution

I got the correct displays by repeating (exactly), in setup(), the needed characters from the character map in SparkFun_Alphanumeric_Display.h (starting line 45) - a few examples.

display.defineChar('<', 0b00110000000000); // '<'
display.defineChar('-', 0b00000101000000); // '-'
display.defineChar('.', 0b00000000000000); // '.'
display.defineChar('/', 0b10010000000000); // '/'

Looks like something relating to board defs or variable declarations are missing either in your code or Arduino's. Sorry, using these for a fast project and don't have time to run this to ground for you.

sfe-SparkFro commented 1 year ago

Thanks for the bug report! I've tested this on my end and confirmed the behavior you're seeing. Looks like the root problem is here:

https://github.com/sparkfun/SparkFun_Alphanumeric_Display_Arduino_Library/blob/db56283074eeac8e1799aad123f1e488860a286f/src/SparkFun_Alphanumeric_Display.cpp#L39-L44

It appears ARDUINO_ARCH_AVR is not defined for the Nano Every, will just add another check for that.

sfe-SparkFro commented 1 year ago

Should be fixed in v2.2.9! Thanks again for the report!

bethanysciences commented 1 year ago

Love you guys, thanks!