Писклявая версия

master
SmartUA 2021-08-03 16:12:08 +03:00
parent 1d66960a3d
commit 69d0fcb68b
1 changed files with 6 additions and 8 deletions

View File

@ -553,12 +553,15 @@ void setup()
delay(50);
pinMode(TRIGGER_PIN, INPUT);
pinMode(Fpin, OUTPUT);
pinMode(Bpin, OUTPUT);
ledcSetup(ledChannel1, freq, resolution);
ledcSetup(ledChannel2, freq, resolution);
ledcAttachPin(Fpin, ledChannel1);
ledcAttachPin(Bpin, ledChannel2);
setMotor(false, false);
WiFi.mode(WIFI_STA);
@ -664,20 +667,15 @@ int setMotor(bool Finput, int Binput)
// digitalWrite(Fpin, HIGH);
ledcDetachPin(Bpin);
ledcWrite(ledChannel1, 200);
digitalWrite(Bpin, LOW);
ledcAttachPin(Fpin, ledChannel1);
ledcWrite(ledChannel1, 100);
}
if (Finput == false && Binput == true)
{
ledcDetachPin(Fpin);
digitalWrite(Fpin, LOW);
ledcWrite(ledChannel2, 100);
ledcWrite(ledChannel2, 200);
// digitalWrite(Bpin, HIGH);
}