I know this is a stupid question, but this makes me curious
Is there another way to print float if using fonts without blinking and stacking?
I use Arduino Mega 2560
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SPFD54124B.h>
#include <Fonts/FreeSevenSegNumFontPlusPlus.h>;
#include <Fonts/FreeMono9pt7b.h>;
#define TFT_CS 33
#define TFT_RESET 32
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
#define GREY 0x7BEF
#define SCR_WD 128
#define SCR_HT 161
float A = 0;
int B = 0;
Adafruit_SPFD54124B display(TFT_RESET, TFT_CS);
void setup(void)
{
display.begin();
display.setRotation(1);
display.fillScreen(BLACK);
}
void loop()
{
A = A+0.01;
//B++;
//display.setFont(&FreeMono9pt7b);
display.setFont(&FreeSevenSegNumFontPlusPlus);
display.setCursor(20, 50);
display.setTextColor(RED,BLACK);
display.setTextSize(1);
display.print(A);
//display.print(B);
//display.fillScreen(BLACK);
delayMicroseconds(10);
}
- characters look good if they don't use fonts and without fiilScreen in loop
- if i use font and fillScreen in loop, the character looks blinking VIDEO
- if i use font and without fillScreen in loop, the previous character is not erased by the new character, so it looks stacked VIDEO
and how is the right way?
thanks, teddy