Problem cleaning up the code

Hi lads
I'm busy on a lilte project and since my Serial LCD doesn't support "println" i have to move the cursor manualy in some cases .
And this is the code i came up with but i cant seem to make an integer of it that can count ... could anyone help me out pleas ?

Thanks in advance !
Greetings

i++;
      if (i==1){
        moveCursor("01", "06");
      }
      if (i==2){
        moveCursor("01", "07");
      }
      if (i==3){
        moveCursor("01", "08");
      }
      if (i==4){
        moveCursor("01", "09");
      }
      if (i==5){
        moveCursor("01", "10");
      }
void moveCursor(char* row, char* column){
  // row
  // 01=First Line -> 02=Second Line

  // column
  // 01=First Position -> 16=Last Position

    Serial.write(0xFE);    
  Serial.print("L");
  Serial.print(row);
  Serial.print(column); 
}

but i cant seem to make an integer of it that can count

What does "it" refer to?

Does the LCD really expect row and column as strings? If you, why not convert row and column as ints to strings using Serial.print()?

Maybe something like this?

char buf[3];
itoa(i + 5, buf, 10);
moveCursor("01", buf);

I'm not sure this is what you want because I don't see much of your code nor do I understand your problem :slight_smile:

Can you try these?

moveCursor(1, 6);
moveCursor(1, 7); .. etc
void moveCursor(int row, int column){
  Serial.write(0xFE);    
  Serial.print((row-1)*16+column-1); 
}

I am referring to Arduino Playground - SparkFunSerLCD

Thx for the reply's already but what i'm trying to do is simulate a serial.println() for my IoBridge Serial LCD (it doens't support serial.println(); )
so actualy i whanted to do it like this

This code wil be runned when a key gets pressed

int keycount = 5;
i++;
      if (i<5){
        keycount++
        moveCursor("01", keycount);
        serial.print(key);
      }

I hope you get the idea what i'm trying to do

A link to the lcd datasheet would be useful, to understand its serial protocol.

tuxduino:
A link to the lcd datasheet would be useful, to understand its serial protocol.

Hope you have enough with this .

http://connect.iobridge.com/docs/function-boards/serial-lcd/
http://www.arduino.cc/playground/Learning/ioBridgeSerialLCD

Thanks Already