board707 / DMD_STM32

STM32Duino library for RGB, Monochrome and Two-color led matrix panels
GNU General Public License v3.0
64 stars 21 forks source link

Showing Numbers on the Panel #84

Closed digi55 closed 6 months ago

digi55 commented 7 months ago

Hi, I want to make on the panel count from 0 to 200. Where, am I making a mistake?

uint16_t Number = 0; uint16_t Yellow = dmd.Color888(255,255,0); dmd.selectFont(&Turk_Arial_F); dmd.setBrightness(100);

for(int i=0; i<200; i++){ dmd.drawStringX(0, 0, Number, Yellow); Number ++; delay(10); }

board707 commented 7 months ago

dmd.drawStringX(0, 0, Number, Yellow);

The function accepts only arrays of chars. Your Number variable is int, it is not a char array. You have to convert int to string first.

Try something like this:

char numstr[10] = {0};
itoa(Number, numstr);
dmd.drawStringX(0, 0, numstr, Yellow);
digi55 commented 7 months ago

Thank you so much, I did it.