[SOLVED] pointers and call functions with char[]

Just a couple of things about your code.

If you pass in a string < 16 characters, it will fail. And if pos is > 1, I don't know what will happen.
Also, use unsigned ints to prevent accidentally using a negative number. If you are going to use strlen() anyway, then you can avoid testing for the \0 character.

The code can be tightened up a bit. Here's an example.

#define LINELEN 16
#define LINES   2

void scroll(char *msg, unsigned int pos) {
        unsigned int l = strlen(msg);
        unsigned int x, y;

        if (pos >= LINES) return;
        lcd.setCursor(0, pos);
        if (l <= LINELEN) {
                delay(1000);
                lcd.print(msg);
                delay(1000);
                return;
        }
        for (x = 0; x <= l - LINELEN; x++) {
                for (y = x; y < x + LINELEN; y++) {
                        lcd.print(msg[y]);
                }
                if (x == 0) delay(800);
                delay(200);
                lcd.setCursor(0, pos);
        }
        delay(800);
}