Hello,
this is my code:
#include <OLED_I2C.h>
#include <SoftwareSerial.h>
int rxPin = 10;
int txPin = 14;
int secondi;
int minuti;
int ore;
int y = 23; //altezza 23 px per stampare a schermo
int x = 90; //centro schermo
String tot;
SoftwareSerial bluetooth(rxPin, txPin);
String message; //string that stores the incoming message
OLED myOLED(SDA, SCL, 8);
extern uint8_t SmallFont[];
void setup()
{
Serial.begin(9600); //set baud rate
bluetooth.begin(9600); //set baud rate
myOLED.begin();
myOLED.setFont(SmallFont);
randomSeed(analogRead(0));
}
void loop()
{
while (bluetooth.available()) {
message += char(bluetooth.read());
}
if (!bluetooth.available())
{
if (message != "")
{ //se il dato è disponibile
// Serial.println(message); //mostra il dato
RicavaOrario(message);
message = ""; //cancella il dato
}
}
// myOLED.print("OLED_I2C Scrolling Text Demo ", 90, y);
// myOLED.update();
if(secondi<60)
{
secondi++;
}
if(secondi==60)
{
secondi=0;
minuti++;
}
if(minuti==60)
{
minuti=0;
ore++;
}
if(ore==24)
{
ore=0;
secondi=0;
minuti=0;
}
//myOLED.print(ore,':',minuti,':',secondi);
tot=String(ore+String(":")+minuti+String(":")+secondi);
Serial.println(tot);
delay(1000); //delay
Stampa(tot);
}
void RicavaOrario(String msg)
{
char Orestring[9]={msg[0],msg[1],msg[2],msg[3],msg[4],msg[5],msg[6],msg[7],NULL};
char s[3]={msg[0],msg[1],NULL};
char m[3]={msg[3],msg[4],NULL};
char o[3]={msg[6],msg[7],NULL};
secondi=atoi(s);
minuti=atoi(m);
ore=atoi(o);
delay(1000);
}
void Stampa(String a)
{
myOLED.print(a, CENTER , y);
myOLED.update();
}
The problem is this part:
extern uint8_t SmallFont[];
myOLED.setFont(SmallFont);
I want to use the BigFont but when i try to change it into BigFont ,Arduino IDE says that there are some errors.
extern uint8_t BigFont[];
myOLED.setFont(BigFont);
The errors are :
-undefined reference to BigFont' -more undefined references to
BigFont' follow
I tried to download some fonts from some sites and put them in the project folder but when I run the code i see that the font in the display has a lot of problems and it is
incomprehensible.
Any solutions?
Sorry if I misspelled some words,I'm from Italy.