hi, I can not write more than 8 new characters on my 4*20 LCD, it seems that after 8 chars the string repeat again!!
I send tow different string "HEATING" & "COOLING" to lcd via farsiprint , and what I see is printing both string in two different place at the same time,
at x=12 , y=0 : HEATING str and at x=5 , y=2 agin: HEATING str is on and 100 mily secs later
at x=12 , y=0 : COOLING str and at x=5 , y=2 agin: COOLING str is on and 100 mily secs later and so on
hear is my code (partly):
first : definition of chars
next: definition of functions
and then calling functions
I have no syntax error and no problem in writing english
byte myfont[27][8]= {
{
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }
,// 0 ff
{
0x03,0x07,0x04,0x02,0x01,0x1F,0x00,0x00 }
,// 1 ?
{
0x00,0x02,0x07,0x00,0x0B,0x1F,0x00,0x00 }
,// 2 ?
{
0x00,0x00,0x00,0x03,0x07,0x1B,0x00,0x00 }
,// 3 ?
{
0x00,0x00,0x00,0x00,0x02,0x1E,0x00,0x0C }
,// 4 ?
{
0x00,0x00,0x00,0x0A,0x12,0x12,0x1E,0x00 }
,// 5 ?
{
0x00,0x00,0x00,0x00,0x0B,0x1F,0x00,0x00 }
,// 6 ? saad
{
0x02,0x0E,0x08,0x04,0x04,0x04,0x04,0x00 }
,// 7 ?
{
0x00,0x00,0x00,0x08,0x04,0x04,0x018,0x00 }
,// 8 ?
{
0x00,0x00,0x00,0x06,0x01,0x1F,0x00,0x02 }
,// 9 ?
{
0x00,0x00,0x00,0x01,0x01,0x01,0x02,0x0C }
,//10 ?
{
0x00,0x04,0x04,0x04,0x04,0x03,0x00,0x00 }
,//11 ?
{
0x00,0x04,0x04,0x04,0x04,0x04,0x04,0x00 }
,//12 ?
{
0x00,0x00,0x03,0x03,0x0F,0x08,0x08,0x08 }
,//13 ?
{
0x00,0x00,0x04,0x06,0x0A,0x0E,0x00,0x00 }
,//14 ?
{
0x00,0x02,0x00,0x06,0x01,0x1F,0x00,0x00 }
,//15 ?
{
0x00,0x08,0x08,0x0B,0x0D,0x1F,0x00,0x00 }
,//16 ?
{
0x00,0x00,0x00,0x03,0x03,0x01,0x02,0x0C }
,//17 ?
{
0x00,0x00,0x00,0x00,0x01,0x1F,0x00,0x04 }
,//18 ?
{
0x00,0x00,0x01,0x00,0x01,0x01,0x02,0x0C }
,//19 ?
{
0x00,0x00,0x00,0x03,0x14,0x12,0x1e,0x00 }
,// 20 ye
{
0x00,0x00,0x00,0x08,0x04,0x07,0x0C,0x00 }
,// 21 ?
{
0x00,0x00,0x00,0x00,0x00,0x07,0x08,0x30 }
,//22 ?-
{
0x00,0x01,0x01,0x01,0x01,0x1E,0x00,0x00 }
, //23 ?
{
0x00,0x10,0x10,0x13,0x17,0x9B,0x00,0x00 }
,// 24 ??
{
0x00,0x14,0x14,0x14,0x15,0x1f,0x00,0x02 }
,// 25 ???
{
0x00,0x07,0x04,0x02,0x01,0x1F,0x00,0x00 }
////261 ?
};
int HEATING[] = {
10 , 8 ,0, 5, 21, 2, 0, 13, 22, 1 }; //1:garm shodan
int COOLING[] = {
5, 21, 2, 0, 8, 22, 6 }; //2:sard shodan
//.........................................................................
Display::Display():
iLcd(6, 7, 8, A5, 16, 17),
iLastState(Thermocycler::EStartup) {
iLcd.begin(20, 4);
//...
}
//...............................FARSIPRINT.....................................
void Display::farsiprint(int* fstr, int lent, int x, int y)
{
for (int ii=0; ii<lent ; ii++){
charnum = fstr[ii];
int hh=0;
hh = ii%8;
iLcd.createChar(hh, myfont[charnum]);
iLcd.setCursor(x+ii,y);
iLcd.write(byte(hh));
//delay(100);
}
}
//..........................................................................
void Display:main(){
farsiprint(HEATING, 5, 12, 0);
delay(100);
//iLcd.clear();
farsiprint(COOLING, 6, 5, 2);
delay(100);
//iLcd.clear();
}
//.....................................................................