Писклявая версия
parent
1d66960a3d
commit
69d0fcb68b
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue