9 years, 3 months ago.

miniFont example won't compile.

Hi,

The example

@code

  1. include "miniFont.h" miniFont myFont;

int main() {

char characterData[5]; char letter = 'x'; if (myFont.getChar(letter,&characterData)) { for (int row = 0; row < myFont.getPixHeight(letter); row++) { for (int col = myFont.getPixWidth(letter) - 1; col >= 0; col) { start at the left no the right if (characterData[row] & (0x01<<col)) printf("1"); else printf("0"); } printf("\n"); } } } @endcode

Has a compile error :

Error: Argument of type "char (*)[5]" is incompatible with parameter of type "const char " in "main.cpp", Line: 9, Col: 31

Question relating to:

A low resolution font for LED matrix displays e.g. neopixels font, NeoPixel, WS2812, wx2811

1 Answer

9 years, 3 months ago.

Sorry, I forgot the change the example when I made a change to how the library worked. It's now correct.

Also see WS2812Text https://developer.mbed.org/users/AndyA/code/WS2812Text/ for a more complex example that uses the library to display text on an LED grid.