0

I've got a MAX7456 chip and I am using this (this is the unmodified one) library with it. There's a sketch inside the examples folder (Max7456WriteTable) that I need to get to work to update the character table.

I modified three lines and then I got really stuck as I do not know how to continue. This is the modified one.

In file included from Max7456Write.ino:2:0:
/tmp/build4608284042510222737.tmp/sketch/Max7456WriteTable.h:29:69153: warning: narrowing conversion of '243' from 'int' to 'const char' inside { } is ill-formed in C++11 [-Wnarrowing]

This happens for every item in the array. But that is not the only problem. (I'll skip a few hundred lines)

/tmp/build8855411239666100148.tmp/sketch/Max7456Write.cpp.o: In function `setup':
/home/t/Max7456Write.ino:13: undefined reference to `Max7456::Max7456(unsigned char)'
/home/t/Max7456Write.ino:19: undefined reference to `Max7456::activateOSD(bool)'
/home/t/Max7456Write.ino:44: undefined reference to `Max7456::getCARACFromProgMem(char const*, unsigned char, unsigned char*)'
/home/t/Max7456Write.ino:46: undefined reference to `Max7456::sendCharacter(unsigned char const*, unsigned char, unsigned char)'
collect2: error: ld returned 1 exit status
Error compiling.

It takes a huge amount of time for it to abort the compilation.

3
  • github.com/arduino/Arduino/wiki/…
    – Gerben
    Aug 16, 2015 at 14:23
  • @Gerben I tried everything I could, it does not compile. I tried changing what is mentioned in the wiki page, it still does not work. The array no matter what I try either complains "duplicate const" or "not constant" or "invalid conversion from int to const char". As a newbie this is way too complex for me.
    – Avamander
    Aug 16, 2015 at 14:39
  • Yeah, it now works when I nuked my install.
    – Avamander
    Aug 18, 2015 at 7:30

1 Answer 1

1

If I change prog_uchar to unsigned char in both max7456.h and max7456.cpp the hello world example sketch compiles.

In Max7456WriteTable change

Max7456::getCARACFromProgMem(i,currentChar); //Because the table is too big for ram memory

osd->sendCharacter(currentChar,i); //We send currentChar at address i.

to

Max7456::getCARACFromProgMem(tableOfAllCharacters, i,currentChar); //Because the table is too big for ram memory

osd->sendCharacter(currentChar,i, 0); //We send currentChar at address i.

0 is probably the wrong value, but at least it compiles.

5
  • Did that already. Check my second download link for my current progress.
    – Avamander
    Aug 16, 2015 at 16:23
  • Just move the contents of Max7456WriteTable.h to Max7456WriteTable.ino, and adding #include <SPI.h> makes the second download compile.
    – Gerben
    Aug 16, 2015 at 18:11
  • Are you using IDE 1.6.6?
    – Avamander
    Aug 16, 2015 at 21:44
  • 1
    1.6.3. I updated to 1.6.6 and still compiles. dropbox.com/s/d3d0mkasvqrea8k/max7456.zip?dl=0
    – Gerben
    Aug 17, 2015 at 9:58
  • 1
    I updated my Arduino IDE version, wiped all libraries, redownloaded them, nuked all configurations and dynamic links I've created to keep consistency in my projects. It now finally works.
    – Avamander
    Aug 17, 2015 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.