I am running a small 12V pump with a digital pin with a transistor and diodes. I need this pump to run for about 60 seconds. How can I format this in my code. This is what I have now and it comes on for about 3-4 seconds and then cuts off.
if (moisture < 2500) {
digitalWrite(pump, HIGH);
delay(1500);
System.sleep(SLEEP_MODE_DEEP,30);
}
else if (moisture >= 2500 ){
System.sleep(SLEEP_MODE_DEEP,30);
}
Depending on what you want the device to do, other than running the pump, making the change proposed by Kenneth would work. Alternatively, have a look into non-blocking delays or software timers