Hi I´m working with the arduino mini pro (ATmega328) and I uploaded the following code:
#include <avr/wdt.h>
#include <Wire.h>
#include "MS5837.h"
MS5837 sensor;
void setup() {
wdt_disable();
Serial.begin(9600);
Wire.begin();
sensor.init();
sensor.setFluidDensity(997); // kg/m^3 (freshwater, 1029 for seawater)
wdt_enable(WDTO_60MS);//es el tiempo que va a durar el loop en ejecucion
}
void loop() {
for(int i=0; i<=1200; i++){
sensor.read();
Serial.print(sensor.pressure());
wdt_reset();//actualiza el watchdog para que no produzca un reinicio
delay(50);
}
delay(70);
}
But then I tried to upload another code and it didn't work, because the arduino is resetting itself constantly.
its there a way that i can reset the arduino without using the programer because looks like it´s not going to work the way I´m trying.