Hey there! How can i control 2 Servos seperately?
My Board: Wemos D1 ESP8266
Code:
Servo servo;
BLYNK_WRITE(V3)
{
servo.write(param.asInt());
}
Servo servo2;
BLYNK_WRITE(V2)
{
servo.write(param.asInt());
}
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
// You can also specify server:
//Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 80);
//Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);
servo.attach(13);
servo2.attach(12);
}
void loop()
{
Blynk.run();
}
Servo Works
Servo2 does not work? why?
Please edit your post and add triple backticks at the beginning and end of your code so that it displays correctly.
Triple backticks look like this:
```
When you’ve done that we’ll take a look at your code and provide some feedback.
Pete.
Sorry, i`ve done it, thanks for the information.
chaosgmd3:
Servo servo; BLYNK_WRITE(V3) { servo.write(param.asInt()); } Servo servo2; BLYNK_WRITE(V2) { servo.write(param.asInt()); } void setup() { // Debug console Serial.begin(9600); Blynk.begin(auth, ssid, pass); // You can also specify server: //Blynk.begin (auth, ssid, pass, “blynk-cloud.com ”, 80); //Blynk.begin (auth, ssid, pass, IPAddress(192,168,1,100), 8080); servo.attach(13); servo2.attach(12); } void loop() { Blynk.run(); }
Should be: (notice the ‘2’)
BLYNK_WRITE(V2)
{
servo2.write(param.asInt());
}
1 Like