void loop(){ /* We'll run around checking for button presses, until it's been a second */ while(millis() % 1000) { if (!digitalRead(buttonPins[2])) setTime(); // If S3 was pressed, go set the time }

/* We'll get here if it's been a second. We need to increase seconds by 1 and then go from there */ seconds++; if (seconds >= 60) { seconds = 0; // If seconds is 60, set it back to 0 minutes++; // and increase minutes by 1 if (minutes >= 60) { minutes = 0; // If minutes is 60, set it back to 0 hours++; // and increase hours by 1 if (hours == 12) ampm ^= 1; // If it's 12 o'clock, flip ampm if (hours >= 13) hours = 1; // If hours is 13, set it to 1. 12-hr clock. } } /* Once each second, we'll redraw the clock with new values */

/* once we have each integer separated, we need to turn them into displayable characters. Adding 0x30 does this (check an ASCII table. We set the colons to 0x0A initially, this will turn them into the proper 0x3A.*/ for (int i=0; i<8; i++) timeChar[i] += 0x30;

unsigned long now = 0;unsigned long time = 0;int x = 320; //or whatever is the size of your screen in pixelint textSize = 150; //or whatever, you have to test for the correct value, or maybe you have a function getTextSize?

void loop(){ now = millis(); if ( now - time >= 10 ) // 10 milliseconds has passed { time = now; lcd.setStr("ArduinoPat", x, 20, C_COLOR, BACKGROUND); x--; if (x < -textSize) //if the text is out of the screen, reset x so the message appear again from the right x = 320; }}

Many thank's for this sketch , but it's not the way what i mean.But any way is it possible for only scroll the text ?No the text scroll together with a black background , is it possible without black background and only text in the testpattern ?

unsigned long now = 0;unsigned long time = 0;int x = 320; //or whatever is the size of your screen in pixelint textSize = 150; //or whatever, you have to test for the correct value, or maybe you have a function getTextSize?

void loop(){ /* We'll run around checking for button presses, until it's been a second */ while(millis() % 1000) { if (!digitalRead(buttonPins[2])) setTime(); // If S3 was pressed, go set the time }

{ now = millis(); if ( now - time >= 10 ) // 10 milliseconds has passed { time = now; lcd.setStr("ArduinoPat", x, 20, C_COLOR, BACKGROUND); x--; if (x < -textSize) //if the text is out of the screen, reset x so the message appear again from the right x = 320; }}

/* We'll get here if it's been a second. We need to increase seconds by 1 and then go from there */ seconds++; if (seconds >= 60) { seconds = 0; // If seconds is 60, set it back to 0 minutes++; // and increase minutes by 1 if (minutes >= 60) { minutes = 0; // If minutes is 60, set it back to 0 hours++; // and increase hours by 1 if (hours == 12) ampm ^= 1; // If it's 12 o'clock, flip ampm if (hours >= 13) hours = 1; // If hours is 13, set it to 1. 12-hr clock. } } /* Once each second, we'll redraw the clock with new values */

/* once we have each integer separated, we need to turn them into displayable characters. Adding 0x30 does this (check an ASCII table. We set the colons to 0x0A initially, this will turn them into the proper 0x3A.*/ for (int i=0; i<8; i++) timeChar[i] += 0x30;