Hello! I have a problem with the joystick. I am trying to control a servo. This works great with the slider element, but does not work with the joystick element.
I watched the Debug console. When I use the slider, I see how the data comes in the console and everything works. I tried different options (write interval, Outpu(split / merge)). But when I use the joystick, the data does not come to the console and servo not working. How can I fix this? Thanks!
Code
#define BLYNK_PRINT Serial
#include <Servo.h>
#include <Blynk.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = “blablabla”;
// Your WiFi credentials.
// Set password to “” for open networks.
char ssid[] = “mywifi”;
char pass[] = “12345678”;
Servo servo;
BLYNK_WRITE(V3) {
int x = param[0].asInt();
servo.write(x);
Serial.println(x, DEC);
}
void setup()
{
// Debug console
Serial.begin(9600);
Blynk.begin(auth, ssid, pass, “myserver.com”, 8081);
servo.attach(15); // 15 means D8 pin of ESP8266
}
void loop()
{
Blynk.run();
}