From c03e60e56ff26b13b8b31c4b7078f2ca8301ee38 Mon Sep 17 00:00:00 2001 From: Erick Ahmed Date: Sat, 17 May 2025 14:07:45 +0200 Subject: [PATCH] Add delay to let actuator pump water --- firmware/atmega/source/pump.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/firmware/atmega/source/pump.c b/firmware/atmega/source/pump.c index 787793b..c911bb2 100644 --- a/firmware/atmega/source/pump.c +++ b/firmware/atmega/source/pump.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "pump.h" #include "config.h" @@ -10,14 +11,15 @@ void pumpsInit(void) { actuatorMask |= (1 << actuatorPins[i]); } DDRD |= actuatorMask; + //PORTD &= ~(1 << actuatorMask); } void triggerPump(uint8_t pump_pin) { // Turn on pump PORTD |= (1 << pump_pin); - // timer for a fixed n milliseconds - // hardcoded for now + _delay_ms(500); + // Here there could be the issue of the AVR hanging when pump is on // Turn off pump PORTD &= ~(1 << pump_pin);