drawChar mit Adafruit GFX-Lib nutzen

Hallo zusammen,
es ist bestimt was ganz banales, aber als Programmiereinsteiger kome ich nicht auf die Lösung.
Es soll einfach ein Buchstabe auf einem Display wiedergegeben werden:

//#define sclk 13
//#define mosi 11
#define cs   10
#define dc   9
#define rst  8  // you can also connect this to the Arduino reset

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>

Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst);

void setup(void) {
  Serial.begin(9600);
  tft.initR(INITR_REDTAB);   // initialize a ST7735R chip, red tab
    Serial.println("init");
    tft.fillScreen(ST7735_BLACK);

// dieser Tesxt wird auf dem Display wiedergeben:
  tft.setCursor(0, 5);
  tft.setTextColor(ST7735_RED);
  tft.setTextWrap(true);
  tft.print("Dieser Text ist ok!");
  
// ein CHAR soll geschrieben werden; klappt nicht =(
  tft.drawChar(0, 20, "A", ST7735_RED, 0, 1);
}

void loop() {
}

void testdrawtext(char *text, uint16_t color) {
  tft.setCursor(0, 0);
  tft.setTextColor(color);
  tft.setTextWrap(true);
  tft.print(text);
}

void drawChar(uint16_t x, uint16_t y, char c, uint16_t color, uint16_t bg, uint8_t size) {
}

Wer kann mir sagen, was ich hier falsch mache?

Gruß, Antiriad

Was sind die Fehlermeldungen bzw Fehlersymptome?
Grüße Uwe

Naja Du definierst eine leere Funktion drawChar in Deinem Sketch, die Du dann aufrufst. Da die Funktion keinen Inhalt hat, passiert natürlich auch nichts.

Sollte es aber eine Fehlermeldung geben, das drawChar() doppelt definiert wurde, dann gibt es diese Funktion in der Lib schon (vermutlich dann auch mit Inhalt) und Du musst die leere Funktion aus Deinem Sketch raus nehmen.

Mario.

Ich habe jetzt mal die Funktion rausgenommen. Compiliert wird ohne Fehlermeldung. Ich habe den Code nochmal vereinfacht.
Eine Beschreibung zur dieser drawChar-Funktion gibt es unter:

(runter scrollen bis zur Beschreibung "Characters and text").

Bei dem Code-Beispiel bekomme ich nur ein blaues Display. Ich erwarte jedoch ein rotes "A" auf schwarzem Hintergrung auf blauem Display:

//#define sclk 13
//#define mosi 11
#define cs   10
#define dc   9
#define rst  8  // you can also connect this to the Arduino reset

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>

Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst);

void setup(void) {
  Serial.begin(9600);
  tft.initR(INITR_REDTAB);   // initialize a ST7735R chip, red tab
    Serial.println("init");
    tft.fillScreen(ST7735_BLUE); // Display mit blau löschen
    
// ein CHAR soll geschrieben werden
int x = 10;              //10 Pixel nach rechts
int y = 10;              //10 Pixel nach unten
char c = 'A';            // Buchstabe "A"
int color = ST7735_RED;  // Textfarbe Rot
int bg = ST7735_BLACK;   // Texthintergrund Schwarz

 void drawChar(uint16_t x, uint16_t y, char c, uint16_t color, uint16_t bg, uint8_t size);

// ...nichts wird ausgegeben.
// tft.drawChar(uint16_t x, uint16_t y, char c, uint16_t color, uint16_t bg, uint8_t size); 
// klappt auch nicht.

}

void loop() {
}

Gruß, Antiriad

Geschafft!

mit folgendem Code wird ein rotes "A" auf schwarzem Hintergrung auf blauem Display geschrieben:

//#define sclk 13
//#define mosi 11
#define cs   10
#define dc   9
#define rst  8  // you can also connect this to the Arduino reset

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>

Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst);

void setup(void) {
  Serial.begin(9600);
  tft.initR(INITR_REDTAB);   // initialize a ST7735R chip, red tab
    Serial.println("init");
    tft.fillScreen(ST7735_BLUE); // Display mit blau löschen
   

// void drawChar(uint16_t x, uint16_t y, char c, uint16_t color, uint16_t bg, uint8_t size);
// so klappt es:

  tft.drawChar(10, 10, 65, ST7735_RED, ST7735_BLACK, 1);

}

void loop() {
}

Danke für die Unterstützung, die mich zur Lösung geführt hat!

Gruß, Antiriad