Hello guys i cannot find any problem with my code but when i display it the last char table also apears on first char table declared.
for
byte xx[8] = {
0b00100,
0b01000,
0b01000,
0b01000,
0b10000,
0b10000,
0b10000,
0b10111
it displays
0b11101,
0b00001,
0b00001,
0b00001,
0b00010,
0b00010,
0b00010,
0b00100
this code was also declared
here: byte b12[8] = {
for some reason the last displayed segment is also displayed at the first one
// include the LCD's library
#include <LiquidCrystal.h>
int once = 0;
byte arrow1[8] = {
0b00000,
0b00000,
0b00000,
0b00000,
0b10001,
0b11011,
0b01110,
0b00100
};
byte arrow2[8] = {
0b00000,
0b00000,
0b00000,
0b10001,
0b11011,
0b01110,
0b00100,
0b00000
};
byte arrow3[8] = {
0b00000,
0b00000,
0b10001,
0b11011,
0b01110,
0b00100,
0b00000,
0b00000
};
byte arrow4[8] = {
0b00000,
0b10001,
0b11011,
0b01110,
0b00100,
0b00000,
0b00000,
0b00000
};
byte arrow5[8] = {
0b10001,
0b11011,
0b01110,
0b00100,
0b00000,
0b00000,
0b00000,
0b00000
};
byte xx[8] = {
0b00100,
0b01000,
0b01000,
0b01000,
0b10000,
0b10000,
0b10000,
0b10111
};
byte a8[8] = {
0b00001,
0b00001,
0b00001,
0b00000,
0b11000,
0b01100,
0b00110,
0b00011
};
byte a9[8] = {
0b10000,
0b10000,
0b10000,
0b00000,
0b00000,
0b00000,
0b00000,
0b10000
};
byte a12[8] = {
0b00100,
0b00010,
0b00010,
0b00010,
0b00001,
0b00001,
0b00001,
0b11101
};
byte b5[8] = {
0b10111,
0b10000,
0b10000,
0b10000,
0b01000,
0b01000,
0b01000,
0b00100
};
byte b7[8] = {
0b00000,
0b00000,
0b00000,
0b00000,
0b00000,
0b00001,
0b00011,
0b00110
};
byte b8[8] = {
0b00001,
0b00011,
0b00110,
0b01100,
0b11000,
0b10001,
0b00001,
0b00001
};
byte b9[8] = {
0b10000,
0b00000,
0b00000,
0b00000,
0b00000,
0b10000,
0b10000,
0b10000
};
byte b12[8] = {
0b11101,
0b00001,
0b00001,
0b00001,
0b00010,
0b00010,
0b00010,
0b00100
};
// initialize library with the numbers of the interface pins:
// (RS, Enable, DB4, DB5, DB6, DB7)
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
void setup() {
lcd.createChar(0, arrow1);
lcd.createChar(1, arrow2);
lcd.createChar(2, arrow3);
lcd.createChar(3, arrow4);
lcd.createChar(4, arrow5);
lcd.createChar(5, xx);
lcd.createChar(6, a8);
lcd.createChar(7, a9);
lcd.createChar(8, a12);
lcd.createChar(9, b5);
lcd.createChar(10, b7);
lcd.createChar(11, b8);
lcd.createChar(12, b9);
lcd.createChar(13, b12);
lcd.begin(16, 2);
}
void loop() {
if(once == 0){
lcd.setCursor(4,0);
lcd.write((uint8_t)5);
lcd.setCursor(7,0);
lcd.write((uint8_t)6);
lcd.setCursor(8,0);
lcd.write((uint8_t)7);
lcd.setCursor(11,0);
lcd.write((uint8_t)8);
lcd.setCursor(4,1);
lcd.write((uint8_t)9);
lcd.setCursor(6,1);
lcd.write((uint8_t)10);
lcd.setCursor(7,1);
lcd.write((uint8_t)11);
lcd.setCursor(8,1);
lcd.write((uint8_t)12);
lcd.setCursor(11,1);
lcd.write((uint8_t)13);
once = 1;
}
}