Send by parameter Char PROGMEM in fonction

Status
Not open for further replies.

kammateo

Member
I'm trying to send a bit map to my function but I have an error: "call of overloaded "
Any ideas?
Thank you so much!

Code:
#include <Adafruit_GFX.h>    // Core graphics library
#include <ST7735_t3.h>       // Hardware-specific library


/*  TFT Pinout for Teensy 3.5   */
#define TFT_SCLK  32  // SCLK can also use pin 14
#define TFT_MOSI  0   // MOSI can also use pin 7
#define TFT_CS    6   // CS & DC can use pins 2, 6, 9, 10, 15, 20, 21, 22, 23
#define TFT_DC    2   //  but certain pairs must NOT be used: 2+10, 6+9, 20+23, 21+22
#define TFT_RST   8   // RST can use any pin
#define SD_CS     4   // CS for SD card, can use any pin

ST7735_t3 tft = ST7735_t3(TFT_CS, TFT_DC, TFT_MOSI, TFT_SCLK, TFT_RST);


static const unsigned char PROGMEM GPS_icon[] =
{
  0xf, 0x0,
  0x3f, 0xc0,
  0x7f, 0xe0,
  0x70, 0xe0,
  0xe0, 0x70,
  0xe0, 0x70,
  0xe0, 0x70,
  0xe0, 0x70,
  0x70, 0xe0,
  0x7f, 0xe0,
  0x3f, 0xc0,
  0x1f, 0x80,
  0xf, 0x0,
  0xf, 0x0,
  0x6, 0x0,
  0x6, 0x0,
  0x0, 0x0
};

void GPSicon(uint16_t posX, uint16_t posY, char *text, uint16_t Width, uint16_t Height, uint16_t color);

void TFTSetup() {
  pinMode(SD_CS, INPUT_PULLUP);  // don't touch the SD card
  tft.initR(INITR_BLACKTAB);    // Initializer for 1.8" TFT
  tft.fillScreen(ST7735_BLACK);
  tft.setRotation(3);

}

void GPSicon(uint16_t posX, uint16_t posY, char *text, uint16_t Width, uint16_t Height, uint16_t color)
{
  tft.drawBitmap( posX,  posY,  text,  Width,  Height,  color);
}


void loop() {
  GPSicon(2, 5, GPS_icon, 12, 17, ST7735_WHITE);
  delay(10);
}
 
What Teensy board is this for?

In particular is it a T2.x or T3.x (or LC).

if 3.x/LC - then programem means nothing. Note: your array is of type "unsigned char" and your functions are "char" so you may need/want to make them the same.

If 2.x - Your function will need to do something to get the PROGMEM array into data memory to be used... Been awhile since I dealt with that.
 
Hi Kurt,
It was for A t3.5. I solved thank you
Is it possible to delete this post?
My error was
Code:
void GPSicon(uint16_t posX, uint16_t posY, char *text, uint16_t Width, uint16_t Height, uint16_t color)
The type was wrong:
Code:
void GPSicon(uint16_t posX, uint16_t posY, const unsigned char *text, uint16_t Width, uint16_t Height, uint16_t color)
Thank you so much Kurt
 
Status
Not open for further replies.
Back
Top