Program Times Out After Approx 30 sec

Hello Forum,

I am currently using an Arduino Mega 2560 along with a 4D Systems uLCD-43PT resistive touchscreen.

I wrote some code to poll button pushes on the touchscreen and then update 3 Visi-Genie objects (4DSystems) on the touchscreen within a non-blocking delay.

If the user selects one of the buttons on the touchscreen, the code turns 2 solenoid valves and a pump on and/or off using mosfets.

I purchased some mosfet modules COM-12959 from Sparkfun to handle the higher voltage and current requirements of the solenoid valves and pump.

See code below:

void loop()
{
   genie.DoEvents();                                   // poll for button presses, keypad, slider, dipswitch
   if(updateTimer > millis()) updateTimer = millis();  // reset timer if overflow
   if(millis() - updateTimer > 250)                    // update display every 250ms
   {
      updateDigits();
      updateScope();
      updateBatteryMeter();
      updateTimer  = millis();                         // reset the updateTimer
   }
}

The problem is that the code runs for about 30 seconds and then freezes up if I let the code run through loop()....even if I don't make any button presses on the touchscreen. Is this a watchdog timer issue?

TIA,
--Neal

If I showed you snippets of code, could you tell me what the program was supposed to do? Neither can we.

Paul

http://snippets-r-us.com