andromeda
05-12-10, 12:16
Hi,
there is a problem with command move cursor on arduino mega 2560.
in the section loop i do:
clear screen
move cursor to line 3
and print 20 caractere in the line3
problem => cursor position is after un moment line1, after line 3, after line 1 etc..
may be is a timing problem with move cursor or clear screen because command clear screen position a cursor in line 1, but i have tested whithout clear command only movecursor and the cursor position is line 1,2,3,4 after a moment.
Where is a problem?
video http://www.youtube.com/watch?v=3-csbGejOuY
the code:
int i;
void setup()
{
Serial2.begin(57600);
}
void loop()
{
clear();
move(3,1);
for (i = 0; i < 20; i++)
{
printchar(4);
delay(40);
}
}
void changeBaud()
{
Serial2.write(0xFE);
Serial2.write(0x39);
Serial2.write(0x01);
delay(3);
}
void clear()
{
Serial2.write(0xFE);
Serial2.write(0x58);
delay(3);
}
void graphinit()
{
Serial2.write(0xFE);
Serial2.write(0x68);
delay(3);
}
void bargraph(byte col, byte row, byte dir, byte length)
{
Serial2.write(0xFE);
Serial2.write(0x7C);
Serial2.write(col);
Serial2.write(row);
Serial2.write(dir);
Serial2.write(length);
delay(3);
}
void printmsg(char *msg)
{
Serial2.print(msg);
}
void printchar(char c)
{
Serial2.print(c);
}
void move(byte row, byte col)
{
Serial2.write(0xFE);
Serial2.write(0x47);
Serial2.write(row);
Serial2.write(col);
delay(3);
}
there is a problem with command move cursor on arduino mega 2560.
in the section loop i do:
clear screen
move cursor to line 3
and print 20 caractere in the line3
problem => cursor position is after un moment line1, after line 3, after line 1 etc..
may be is a timing problem with move cursor or clear screen because command clear screen position a cursor in line 1, but i have tested whithout clear command only movecursor and the cursor position is line 1,2,3,4 after a moment.
Where is a problem?
video http://www.youtube.com/watch?v=3-csbGejOuY
the code:
int i;
void setup()
{
Serial2.begin(57600);
}
void loop()
{
clear();
move(3,1);
for (i = 0; i < 20; i++)
{
printchar(4);
delay(40);
}
}
void changeBaud()
{
Serial2.write(0xFE);
Serial2.write(0x39);
Serial2.write(0x01);
delay(3);
}
void clear()
{
Serial2.write(0xFE);
Serial2.write(0x58);
delay(3);
}
void graphinit()
{
Serial2.write(0xFE);
Serial2.write(0x68);
delay(3);
}
void bargraph(byte col, byte row, byte dir, byte length)
{
Serial2.write(0xFE);
Serial2.write(0x7C);
Serial2.write(col);
Serial2.write(row);
Serial2.write(dir);
Serial2.write(length);
delay(3);
}
void printmsg(char *msg)
{
Serial2.print(msg);
}
void printchar(char c)
{
Serial2.print(c);
}
void move(byte row, byte col)
{
Serial2.write(0xFE);
Serial2.write(0x47);
Serial2.write(row);
Serial2.write(col);
delay(3);
}