以下の設定があります。私のarduinoが再び再起動していることがわかりました。私はArduinoボード、LCDディスプレイ、センサーを持っています。センサーと LCD ディスプレイは、7812 レギュレータ IC を使用して、7805 IC と Arduino ボードから共通のグランドと 5v 電源を共有します。最後に、それらは共通の接地電位の下にあります.今、私はコードのピースを持っています. 個別に各機能を試してみましたが、エラーは発生せず、Arduino ボードはリセットされません。すべてのコード ブロックをまとめると。再起動中。再起動すると、数分間正常に動作し、再びリセットされます。
この問題を解決するにはどうすればよいですか?
#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(); }
これらの関数を Serial.println ステートメントに追加しました
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);
}