Hi im trying to send a string to a 8x8 led matrix with max7219, heres my code:
#include "LedControlMS.h"
LedControl lc = LedControl(12,11,10,1);
void setup()
{
for(int x =0; x<1; x++)
{
lc.shutdown(x,false);
lc.setIntensity(x,8);
lc.clearDisplay(x);
}
}
void loop()
{
lc.writeString(0,"string" );
lc.clearAll();
delay(1000);
}
the problem is that the line: " lc.writeString(0,"string" );" gives the warming: "deprecated conversion from string constant to 'char*' [-Wwrite-strings]" and the led matrix doesnt show anything, not even in the proteus simulation.
i would appreciate your help.
Probably, editing the library function 'writeString' so the string parameter is declared 'const' would do it.
aarg:
Probably, editing the library function 'writeString' so the string parameter is declared 'const' would do it.
How do i do that exactly?
If you don't want to edit the library, you can cast the string literal as a (char *). It's kind of a hack, but it should work.
gfvalvo:
If you don't want to edit the library, you can cast the string literal as a (char *). It's kind of a hack, but it should work.
Could show a code of that? please
It's just a warning, not the reason why it does not work (whatever that means).
I'm not familiar with the library that you use but writing something to the 'display' and next clearing the 'display' straight away does not make sense to me.
It is solved, in the ledcontrol instance i just had to change the order of the pins cuz the order was DIN, clock and load:
LedControl lc = LedControl(12,10,11,1);
thanks for the help anyways.