I have below setup. I found that My arduino Getting restarted again. I have Arduino board , lCD Display, SENSOR. The Sensor and LCD Display SHARE common ground and 5v supply from 7805 IC and Arduino board get powered on using 7812 regulator IC . finally they are under common ground potential.Now i have Peice of code. Individually i tried each function are working fine without any error and Arduino Board will not get reseted.When i put together all my code block. getting restarted. Once it restart work fine for couple of minute and again reseted.
How to resolve this issue?
#include <LiquidCrystal.h> #include <avr/wdt.h> LiquidCrystal lcd(12, 11, 7, 6, 5, 4); void setup() { Serial.begin(9600); wdt_enable(WDTO_8S); MODE=INIT; pinMode(beeper, OUTPUT); lcdClear(); } void loop() { Track_loop(); LCD_Display(); CHK_Key(); wdt_reset(); Serial.println(".........................."); } void Track_loop() { calcPos(); calcTime(); calcElevationAngle(); callMode(); actuate(); // checkHWFaults(); Wind_calc(); Print_Result(); } void Print_Result() { Print_Date(); Print_Time(); }
I have added these function in my Serial.println statement
void Print_Date(){
Serial.print("Local Date:");
Serial.print(local_day);
Serial.print("/");
Serial.print(local_month);
Serial.print("/");
Serial.println(local_year);
}
void Print_Time()
{ Serial.print("local_time is:");
Serial.print(local_h);
Serial.print("-");
Serial.print(local_m);
Serial.print("-");
Serial.println(local_s);
}