Blynk 2.0 Joystick Widget issues

• Hardware model + communication type. ESP32 WROOM Using WiFi
• Smartphone OS (iOS or Android) + version iPhone iOS 14.6
• Blynk server or local server Blynk server
• Blynk Library version 1.0.0 (New Version)
• Add your sketch code.

I have been trying to get the Joystick widget to work in “Merge” mode but can’t seem to get it to work. I have just edited the Edgent ESP32 sketch to include my template ID and device name as well as the example code for the joystick widget. Although information for connecting to the Blynk cloud is displayed on the serial monitor I can’t seem to get X/Y data to show up. I have tried DEBUG_PRINT instead of Serial.print but nothing changes.

// Fill-in information from your Blynk Template here
#define BLYNK_TEMPLATE_ID "XXXXXX" // Edited this out 
#define BLYNK_DEVICE_NAME "XXXX" // Edited this out 

#define BLYNK_FIRMWARE_VERSION        "0.1.0"

#define BLYNK_PRINT Serial
//#define BLYNK_DEBUG

#define APP_DEBUG

// Uncomment your board, or configure a custom board in Settings.h
//#define USE_WROVER_BOARD

#include "BlynkEdgent.h"

BLYNK_WRITE(V4) // Executes when the value of virtual pin 1 changes
{
  int x = param[0].asInt();
  int y = param[1].asInt();

  Serial.print("X = ");
  Serial.print(x);
  Serial.print("Y = ");
  Serial.print(y);
}

void setup()
{
  Serial.begin(115200);
  delay(100);

  BlynkEdgent.begin();
}
  
void loop() {
  BlynkEdgent.run();
}

@Pantone_Diago please edit your post, using the pencil icon at the bottom, and add triple backticks at the beginning and end of your code.
Triple backticks look like this:
```

Pete.

1 Like

What exactly is displayed?

How have you configured your V4 datastream in the web portal, in particular, what minimum and maximum values have you defined?

Pete.

Your datastream should be of “String” type. Need to improve this :wink:
Please try it and let us know if it helps

2 Likes

Screen Shot 2021-06-22 at 4.15.15 PM

I edited the data stream to a string and that seemed to help but now I’m just getting values from param[1].asInt();

@Dmitriy check this out

I’ve done some more digging into this and it seems there is an issue with the “String” datastream. When I set a virtual pin as a “String” the associated virtual pin disappears in the list of available data streams in the app. However, when I change the data stream back to an Integer it shows up again. This could be related to why I’m just getting values from param[1].asInt(); with a merged joystick widget.

@Pantone_Diago please create a new pin, on a new virtual pin (string). We haven’t reprodcued the issue.

I tried what you had suggested with the same result but then I tried with an Android device with no issues. It seems iPhone only returns param[1].asInt() while Android returns both param[0].asInt() and param[1].asInt().

@Eugene - one for you to look at?

Pete.

3 Likes

Also noticed that almost every time I move it it drops down about 10% just before responding. iOS app. (Seems just like the issue on the legacy app a year ago)

Using string datastream in Joystick in merge mode will be fixed in next update. Thanks for report.