void writeBuffer(char row, char col, char* text)
{
//first, write the text to your buffer:
char offset = 0;
while(1)
{
if (text[offset]==0) { break; }
if (offset + col >= MAX_COLS) { row++; }
if (row >= MAX_ROWS) { break; } //can't keep going if there isn't space
lcdBuffer[col + offset][row] = text[offset];
offset++;
}
//and when you are done with that, use those built commands to output the entire buffer into the lcd
//...
}
void shiftBufferRowRight(char row)
{
char i,j,temp;
if (row> MAX_ROWS - 1 || row < 0) { return; } //if the row doesn't exist, don't bother
//shift the given row right
temp = lcdBuffer[39][row]; //the last character shall be first
for(i = 0;i < MAX_COLS;i++)
{
j = lcdBuffer[i][row];
lcdBuffer[i][row] = temp;
temp = j;
}
//do the same thing that you did earlier to output the buffer to the lcd using those handy dandy built in functions...
}