lcd 16x2짜리에 '탑승인원'을 출력하고 싶은데
코딩은 아래처럼 했고요
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 10, 11, 12, 13);
byte SpecialChar1[8] = { B11111, B10000, B10000, B11111, B10000, B10000, B10000, B11111 };
byte SpecialChar2[8] = { B00100, B00100, B00100, B00100, B00111, B00100, B00100, B00100 };
byte SpecialChar3[8] = { B00001, B00010, B00100, B01000, B00000, B00000, B00000, B11111 };
byte SpecialChar4[8] = { B10000, B01000, B00100, B00010, B00000, B00000, B00000, B11111 };
/*ㅌ ㅏ ㅅ ㅡ*/
byte SpecialChar9[8] = { B00100, B00100, B00100, B00111, B00100, B00100, B00111, B00000 };
byte SpecialChar10[8] = { B00100, B00100, B00100, B11100, B00100, B00100, B11100, B00000 };
byte SpecialChar11[8] = { B00011, B00100, B01000, B01000, B01000, B00100, B00011, B00000 };
byte SpecialChar12[8] = { B11000, B00100, B00010, B00010, B00010, B00100, B11000, B00000 };
/*ㅂ ㅇ*/
byte SpecialChar5[8] = { B00100, B01010, B10001, B10001, B10001, B01010, B00100, B00000 };
byte SpecialChar6[8] = { B00100, B00100, B00100, B00100, B00100, B00100, B00100, B00100 };
byte SpecialChar7[8] = { B00000, B00100, B01010, B10001, B10001, B10001, B01010, B00100};
byte SpecialChar8[8] = { B00000, B00000, B00000, B00100, B00100, B00100, B00100, B00100 };
/*ㅇ ㅣ ㅇ ㅓ*/
byte SpecialChar13[8] = { B00000, B00100, B00100, B00100, B00100, B00100, B00111, B00000 };
byte SpecialChar14[8] = { B00000, B00000, B00000, B00000, B00000, B00000, B11100, B00000 };
byte SpecialChar15[8] = { B01111, B00010, B00010, B01010, B01000, B01000, B01111, B00000 };
byte SpecialChar16[8] = { B10100, B00100, B11100, B00100, B00100, B00000, B11000, B00000 };
/*ㄴ ㅝ ㄴ*/
void setup()
{
lcd.begin(16, 2);
lcd.createChar(0, SpecialChar1);
lcd.createChar(1, SpecialChar2);
lcd.createChar(2, SpecialChar3);
lcd.createChar(3, SpecialChar4);
lcd.createChar(4, SpecialChar5);
lcd.createChar(5, SpecialChar6);
lcd.createChar(6, SpecialChar7);
lcd.createChar(7, SpecialChar8);
for (int i = 0 ; i <8 ; i++) { lcd.setCursor(i, 0); lcd.write(byte(i)); }
lcd.createChar(8, SpecialChar9);
lcd.createChar(9, SpecialChar10);
lcd.createChar(10, SpecialChar11);
lcd.createChar(11, SpecialChar12);
lcd.createChar(12, SpecialChar13);
lcd.createChar(13, SpecialChar14);
lcd.createChar(14, SpecialChar15);
lcd.createChar(15, SpecialChar16);
for (int i = 8 ; i <16 ; i++) { lcd.setCursor(i-8,1); lcd.write(byte(i)); }
}
void loop()
{}
이런식으로 코딩을 하면 '탑승인원'의 윗부분은 나오지 않고 아래부분만 1행 2행에 반복되네요
어떻게 고쳐야 '탑승인원'이 제대로 나올까요?
|