Need help on my first Program!

Hi all,

this is my first post which means first program issues!

I am playing about with an DF Robot LCD keypad shield on an arduino duemilanove with ATmega328.

im printing text and then changing the text after 5 seconds, and again at 10, but at 15 seconds i want it to reset and repeat the same steps.

Ive played around with while loops but that wont work as it nothing is set to RESET at 15 seconds, also messed around with different timing libaries, but as it is something that to me sounds so simple but hard to do, there must be an easy way to do it!

Any help would be greatly appreciated.

Thanks!

I'm sure there is an easy way, but without seeing your code, it is absolutely impossible.

Use code tags.

Oh sorry.

// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
//LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);

void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("5995 Pounds");
int var;
unsigned long Starttime;
}

void loop() {
lcd.setCursor(0,1);
lcd.print(millis()/1000);

if (millis() == 5000) {
lcd.setCursor(0,0);
lcd.print ("50000 Miles ");
digitalWrite(13, HIGH);
}
if (millis() == 10000) {
lcd.setCursor(0,0);
lcd.print ("Tax = 150 Pounds ");
digitalWrite(13, HIGH);

}}

Thats my code at the minute.

Thanks

  1. use code tags when posting code.

  2. Always auto format your code before posting

  3. mills returns the number if mills since you last reset the processor

4

int var;
unsigned long Starttime;

are point less.

And last but not least - understand and use the ideas in blink without delay.

Mark