This commit is contained in:
olikraus 2017-05-31 23:18:10 +02:00
parent f7c277f3b5
commit 0fa21b8969
3 changed files with 10 additions and 4 deletions

View File

@ -132,7 +132,13 @@ static uint8_t u8x8_d_max7219_generic(u8x8_t *u8x8, uint8_t msg, uint8_t arg_int
case U8X8_MSG_DISPLAY_SET_CONTRAST:
u8x8_cad_StartTransfer(u8x8);
u8x8_cad_SendCmd(u8x8, 10 ); /* brightness */
u8x8_cad_SendArg(u8x8, (arg_int>>16) ); /* 0..15 for contrast */
u8x8_cad_SendArg(u8x8, (arg_int>>4) ); /* 0..15 for contrast */
u8x8_cad_SendCmd(u8x8, 10 ); /* brightness */
u8x8_cad_SendArg(u8x8, (arg_int>>4) ); /* 0..15 for contrast */
u8x8_cad_SendCmd(u8x8, 10 ); /* brightness */
u8x8_cad_SendArg(u8x8, (arg_int>>4) ); /* 0..15 for contrast */
u8x8_cad_SendCmd(u8x8, 10 ); /* brightness */
u8x8_cad_SendArg(u8x8, (arg_int>>4) ); /* 0..15 for contrast */
u8x8_cad_EndTransfer(u8x8);
break;
#endif

View File

@ -158,14 +158,13 @@ the font data. The font data can be pasted into an existing file of your project
Q: Which commandline options are required for bdfconv?
A: "bdfconv -f 1 -m '32-255' -n fontname -o myfont.c myfont.bdf"
"-f 1" generates a u8g2 font.
"-m '32-255'" selects unicode 32 to 255.
"-m '32-255'" selects unicode 32 to 255. On Windows, please use double quotes: -m "32-255"
"-n fontname": This is the name of the font in C/C++/Ino files.
"-o myfont.c": The font array will be stored in this file.
"myfont.bdf": The input file with the font data (bdf format).
Note: Use double quotes for the -m argument on Windows.
Q: Where do I find bdfconv?
A: A Windows executable is available at here:
A: A Windows executable is available here:
https://github.com/olikraus/u8g2/tree/master/tools/font/bdfconv
Use the Makefile in this directory to create a Linux binary.

View File

@ -50,6 +50,7 @@ U8G2_MAX7219_32X8_F_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 11, /* data=*/ 12, /* cs
void setup(void) {
u8g2.begin();
u8g2.setContrast(10*16);
}
void loop(void) {