This is the code.
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_PCD8544.h>
static const uint8_t lt_bmp[] PROGMEM = {0x00, 0x10, 0x30, 0x7f, 0xff, 0x7f, 0x30, 0x10};
static const uint8_t up_bmp[] PROGMEM = {0x10, 0x38, 0x7c, 0xfe, 0x38, 0x38, 0x38, 0x38};
static const uint8_t rt_bmp[] PROGMEM = {0x00, 0x08, 0x0c, 0xfe, 0xff, 0xfe, 0x0c, 0x08};
static const uint8_t dw_bmp[] PROGMEM = {0x38, 0x38, 0x38, 0x38, 0xfe, 0x7c, 0x38, 0x10};
static const uint8_t k1_bmp[] PROGMEM = {0x00, 0xfe, 0xfe, 0xc6, 0xd6, 0xc6, 0xfe, 0xfe};
static const uint8_t k2_bmp[] PROGMEM = {0x3c, 0x42, 0x81, 0x81, 0x81, 0x81, 0x42, 0x3c};
static const uint8_t* const bmp_table[] PROGMEM = {k1_bmp, k2_bmp, lt_bmp, up_bmp, rt_bmp, dw_bmp};
void setup(){}
void loop(){
if (digitalRead(KEY1) == HIGH) newKeyIn(0);
delay(1000);
}
void newKeyIn(uint8_t n) {
uint8_t c=2;
lcd.drawBitmap(40, 18, bmp_table[n] , 8, 8, 1); // incorrect to display
lcd.drawBitmap(40, 18, bmp_table
, 8, 8, 1); //correct!
lcd.drawBitmap(40, 18, bmp_table[1] , 8, 8, 1); //correct![/color]
lcd.display();
}
The same variables, but different results, so I was confused.
Can someone tell me why?
Thanks!