Some fine tuning for 12V

This commit is contained in:
Joe Tretter
2022-08-12 15:18:44 -05:00
parent 7b667df66e
commit 5cd0c50a35

View File

@@ -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);