Hello everyone! I am trying to run a program that controls a DC motor. I've tried the program and the motor runs perfectly but the serial monitor is not showing anything as I intended, not even the "Start" in the void setup. Here is my code:
const int motorPin1 = 26;
const int motorPin2 = 27;
const int buzzerPin = 25;
int motorEn = 0;
void setup() {
Serial.begin(9600);
Serial.print("Start!");
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(motorEn, OUTPUT);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorEn, 0);
}
void loop() {
unsigned long startTime = millis();
float counter = 0.0;
while (millis() - startTime < 6 * 60 * 60 * 1000) {
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
digitalWrite(motorEn, 255);
counter += 4.3;
delay(1 * 60 * 1000);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorEn, 0);
delay(3 * 60 * 1000 + 11 * 1000);
Serial.println(counter);
}
}
Is there anything wrong with it?
Thank you in advance for your responses!