From 5cd0c50a35bd992240af864b2346620d55e38537 Mon Sep 17 00:00:00 2001 From: Joe Tretter Date: Fri, 12 Aug 2022 15:18:44 -0500 Subject: [PATCH] Some fine tuning for 12V --- src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 3bb16f8..cba3f45 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -38,7 +38,7 @@ int enable1Pin = 14; const int freq = 30000; const int pwmChannel = 0; const int resolution = 8; -int dutyCycle = 200; +int motorSpeed = 220; // motor speed, max 355 WebServer server(80); @@ -151,7 +151,7 @@ void setup(void) { // attach the channel to the GPIO to be controlled ledcAttachPin(enable1Pin, pwmChannel); - ledcWrite(pwmChannel, 255); + ledcWrite(pwmChannel, motorSpeed); Serial.begin(9600); @@ -205,7 +205,7 @@ void setup(void) { Serial.println("Moving Forward"); digitalWrite(motor1Pin1, LOW); digitalWrite(motor1Pin2, HIGH); - delay(3000); + delay(1000); // Stop the DC motor digitalWrite(motor1Pin2, LOW); @@ -216,7 +216,7 @@ void setup(void) { Serial.println("Moving Backward"); digitalWrite(motor1Pin1, HIGH); digitalWrite(motor1Pin2, LOW); - delay(3000); + delay(1000); // Stop the DC motor digitalWrite(motor1Pin1, LOW);