Help need using BigFont Library

I am trying to use the BigFont library available @ BigFont_Library. i want to use 3x3 BigFonts(3 rows x 3 Columns). i am unable to initialize the library and print a big font digit. just trying to initialize in setup gives me error. Please help


#include <LiquidCrystal.h>
#include <BigFont.h>

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);  // Define LCD display pins RS, E, D4, D5, D6, D7
void setup() {
 //Serial.begin(115200);
 lcd.begin(20, 4);
 lcd.clear();
 BigFont BigFont(3);

}

void loop() {
 }

BigFont-master (1).zip (199.2 KB)
BigFont.cpp (4.2 KB)
BigFont.h (8.6 KB)
README.txt (1.9 KB)

Please post the full error message

BigFont_Errors.txt (12.7 KB)

FQBN: arduino:avr:nano
Using board 'nano' from platform in folder: C:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Using core 'arduino' from platform in folder: C:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6

Detecting libraries used...
C:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs C:\Users\ADMIN\AppData\Local\arduino\sketches\08FF0342A13D361310AD28A626F28D91\sketch\BigFontDemo.ino.cpp -o nul
Alternatives for LiquidCrystal.h: [LiquidCrystal@1.0.7]
ResolveLibrary(LiquidCrystal.h)
-> candidates: [LiquidCrystal@1.0.7]
C:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\ADMIN\AppData\Local\Arduino15\libraries\LiquidCrystal\src C:\Users\ADMIN\AppData\Local\arduino\sketches\08FF0342A13D361310AD28A626F28D91\sketch\BigFontDemo.ino.cpp -o nul
Alternatives for BigFont.h: [BigFont@0.0.0]
ResolveLibrary(BigFont.h)
-> candidates: [BigFont@0.0.0]
C:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\ADMIN\AppData\Local\Arduino15\libraries\LiquidCrystal\src -Ic:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src C:\Users\ADMIN\AppData\Local\arduino\sketches\08FF0342A13D361310AD28A626F28D91\sketch\BigFontDemo.ino.cpp -o nul
Using cached library dependencies for file: C:\Users\ADMIN\AppData\Local\Arduino15\libraries\LiquidCrystal\src\LiquidCrystal.cpp
C:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\ADMIN\AppData\Local\Arduino15\libraries\LiquidCrystal\src -Ic:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp -o nul
Generating function prototypes...
C:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -IC:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino -IC:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs -IC:\Users\ADMIN\AppData\Local\Arduino15\libraries\LiquidCrystal\src -Ic:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src C:\Users\ADMIN\AppData\Local\arduino\sketches\08FF0342A13D361310AD28A626F28D91\sketch\BigFontDemo.ino.cpp -o C:\Users\ADMIN\AppData\Local\Temp\424586196\sketch_merged.cpp
C:\Users\ADMIN\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives C:\Users\ADMIN\AppData\Local\Temp\424586196\sketch_merged.cpp
Compiling sketch...
"C:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IC:\Users\ADMIN\AppData\Local\Arduino15\libraries\LiquidCrystal\src" "-Ic:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src" "C:\Users\ADMIN\AppData\Local\arduino\sketches\08FF0342A13D361310AD28A626F28D91\sketch\BigFontDemo.ino.cpp" -o "C:\Users\ADMIN\AppData\Local\arduino\sketches\08FF0342A13D361310AD28A626F28D91\sketch\BigFontDemo.ino.cpp.o"
Compiling libraries...
Compiling library "LiquidCrystal"
Using previously compiled file: C:\Users\ADMIN\AppData\Local\arduino\sketches\08FF0342A13D361310AD28A626F28D91\libraries\LiquidCrystal\LiquidCrystal.cpp.o
Compiling library "BigFont"
"C:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR "-IC:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\ADMIN\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\eightanaloginputs" "-IC:\Users\ADMIN\AppData\Local\Arduino15\libraries\LiquidCrystal\src" "-Ic:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src" "c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp" -o "C:\Users\ADMIN\AppData\Local\arduino\sketches\08FF0342A13D361310AD28A626F28D91\libraries\BigFont\BigFont.cpp.o"
In file included from c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp:23:0:
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.h:55:45: error: 'byte' has not been declared
void printblankchar(LiquidCrystal& lcd, byte col, byte row);
^~~~
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.h:55:55: error: 'byte' has not been declared
void printblankchar(LiquidCrystal& lcd, byte col, byte row);
^~~~
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.h:56:43: error: 'byte' has not been declared
void printbigchar(LiquidCrystal& lcd, byte digit, byte col, byte row);
^~~~
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.h:56:55: error: 'byte' has not been declared
void printbigchar(LiquidCrystal& lcd, byte digit, byte col, byte row);
^~~~
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.h:56:65: error: 'byte' has not been declared
void printbigchar(LiquidCrystal& lcd, byte digit, byte col, byte row);
^~~~
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.h:74:5: error: 'byte' does not name a type; did you mean 'system'?
byte custchar2[7][8] =
^~~~
system
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.h:158:5: error: 'byte' does not name a type; did you mean 'system'?
byte custchar3[8][8] =
^~~~
system
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.h:244:5: error: 'byte' does not name a type; did you mean 'system'?
byte bignums[10][4][4] =
^~~~
system
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.h:309:5: error: 'byte' does not name a type; did you mean 'system'?
byte bignums3x3[10][3][3] =
^~~~
system
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.h:365:4: error: 'byte' does not name a type; did you mean 'system'?
byte bignums3x2[10][2][3] =
^~~~
system
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp: In member function 'void BigFont::loadchars(LiquidCrystal&)':
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp:49:23: error: 'custchar2' was not declared in this scope
lcd.createChar(0, custchar2[0]);
^~~~~~~~~
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp:49:23: note: suggested alternative: 'putchar'
lcd.createChar(0, custchar2[0]);
^~~~~~~~~
putchar
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp:56:23: error: 'custchar3' was not declared in this scope
lcd.createChar(7, custchar3[7]); // bell (same for all fonts)
^~~~~~~~~
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp:56:23: note: suggested alternative: 'putchar'
lcd.createChar(7, custchar3[7]); // bell (same for all fonts)
^~~~~~~~~
putchar
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp:60:23: error: 'custchar3' was not declared in this scope
lcd.createChar(0, custchar3[0]);
^~~~~~~~~
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp:60:23: note: suggested alternative: 'putchar'
lcd.createChar(0, custchar3[0]);
^~~~~~~~~
putchar
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp: At global scope:
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp:73:50: error: 'byte' has not been declared
void BigFont::printblankchar(LiquidCrystal& lcd, byte col, byte row)
^~~~
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp:73:60: error: 'byte' has not been declared
void BigFont::printblankchar(LiquidCrystal& lcd, byte col, byte row)
^~~~
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp:90:48: error: 'byte' has not been declared
void BigFont::printbigchar(LiquidCrystal& lcd, byte digit, byte col, byte row)
^~~~
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp:90:60: error: 'byte' has not been declared
void BigFont::printbigchar(LiquidCrystal& lcd, byte digit, byte col, byte row)
^~~~
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp:90:70: error: 'byte' has not been declared
void BigFont::printbigchar(LiquidCrystal& lcd, byte digit, byte col, byte row)
^~~~
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp: In member function 'void BigFont::printbigchar(LiquidCrystal&, int, int, int)':
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp:103:25: error: 'class BigFont' has no member named 'bignums3x2'
lcd.write(this->bignums3x2[digit][i][j]);
^~~~~~~~~~
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp:112:25: error: 'class BigFont' has no member named 'bignums3x3'
lcd.write(this->bignums3x3[digit][i][j]);
^~~~~~~~~~
c:\Users\ADMIN\Documents\Arduino\libraries\BigFont\src\BigFont.cpp:121:25: error: 'class BigFont' has no member named 'bignums'
lcd.write(this->bignums[digit][i][j]);
^~~~~~~

Using library LiquidCrystal at version 1.0.7 in folder: C:\Users\ADMIN\AppData\Local\Arduino15\libraries\LiquidCrystal
Using library BigFont at version 0.0.0 in folder: C:\Users\ADMIN\Documents\Arduino\libraries\BigFont
exit status 1

Compilation error: exit status 1

Example of use is:

    BigFont bigfont(3); // declaration, 2 for 3colx2rows, 3 for 3colx3rows or 4 4colx4rows digits
    
    bigfont.setFontSize(size); // can be used to change display font size 2,3 or 4 at runtime
    
    // somewhere in the code...

    	if(_bigFontSize == 2){
		bigfont.printbigchar(lcd, 0, 0, 0);
		bigfont.printbigchar(lcd, this->_dt.hour, 3, 0);
	} else if(_bigFontSize == 3){
		bigfont.printbigchar(lcd, 0, 0, 0);
		bigfont.printbigchar(lcd, this->_dt.hour, 3, 0);
	} else {
		bigfont.printbigchar(lcd, 0, 0, 0);
		bigfont.printbigchar(lcd, this->_dt.hour, 4, 0);
	}

The BigFont.h file seems to lack an include statement for Arduino.h, not sure how it ever compiled correctly since without that include the byte data type is not defined. Likely it depended on LiquidCrystal.h including Arduino.h, but the version I have does not.

Even after putting #include <Arduino.h> produces the same error 'byte' has not been declared

Did you put the include statement in the BigFont.h file? Putting it in the sketch will not help.

1 Like

The errors have gone. Sorry I unmarked your answer as solution. New problem arises


#include <LiquidCrystal.h>
#include <BigFont.h>

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);  // Define LCD display pins RS, E, D4, D5, D6, D7
void setup() {
  //Serial.begin(115200);
  lcd.begin(20, 4);
  lcd.clear();
  BigFont BigFont(3);
  BigFont.loadchars(lcd);
  BigFont.printbigchar(lcd, 1, 3, 0); // This prints
}

void loop() {
  for(byte i = 0; i < 10;i++){
    BigFont.printbigchar(lcd, i, 3, 0); //This gives error
// expected unqualified-id before '.' token
//     BigFont.printbigchar(lcd, i, 8, 0);
//            ^
    delay(1000);
  }
}

please guide

Where did you get the BigFont library from ?

All details mentioned in my original post

I found the problem

BigFont BigFont(3);

Should not declare this in setup

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.