Hello. Currently I'm working on creating an automatic dog food dispenser. I'm using a Arduino Uno R3, an L298N stepper driver, a DS1307 RTC breakout board, a Nema 17 stepper motor, and a breadboard to disperse the power to each board. I'm using a 9V battery to power it temporarily. I've tested motor control without it being determined by the current time and it works perfectly however when I have the motor run at a specific time (4:45 and 6:45 in the code) the motor doesn't move. How can I move the motor at these specific times?
#include <RTClib.h>
#include <Stepper.h>
#include <SoftwareSerial.h>
RTC_DS1307 rtc;
Stepper myStepper(200 , 9 , 10 , 11 , 12);
void setup() {
Serial.begin(9600);
rtc.adjust(DateTime(2021 , 7 , 14 , 4 , 44 , 0));
myStepper.setSpeed(20);
}
void loop() {
DateTime now = rtc.now();
if ((now.hour() == 4 and now.minute() == 45) or (now.hour() == 6 and now.minute() == 45)) {
Serial.println("testing");
myStepper.step(10000);
delay(1000);
}
}