One-axis joystick occasionally picks up 2nd axis

I have a joystick in my project. Here’s the specs:

  • The horizontal axis has no pin assigned
  • Vertical axis has a virtual pin assigned, range -1000 to 1000, squiggly thing enabled (I don’t know what that’s called)
  • Output set to Split, not merge
  • Autoreturn: on
  • Rotate on tilt: on
  • Write Interval: 100ms

Usually, it behaves just as it should. If i move the joystick all the way to the left, the vertical value remains at (or around) 0 as you’d expect. If I move it up or down, the vertical value behaves totally normally.

BUT, sometimes, in a pattern I’ve yet to identify, it gets in a mode where moving off-axis to the left or right does influence the value it’s sending. In the case of my system, the joystick controls a motor, and the motor moves erratically when this happens. I can see the joystick value for the vertical axis in the UI (upper left of the joystick control) reading out big values when I’m a little off axis horizontally but still near 0 vertically. So, it’s not just about my Arduino receiving the wrong values; the Blynk UI confirms that the joystick is being influenced by the horizontal axis when it shouldn’t.

It seems to enter this mode after a reconnect (Arduino reboot) from time to time.

I can fix this by going into settings in the Blynk app, opening the Joystick settings, and backing out again.

I’m using Blynk v 2.26.7 on Android (Google Pixel, and Asus Tablet both have this issue).
I’m using Blynk Cloud.
Not that it’s likely to be relevant, but my app is running on an M5Stack, communicating over BLE.

I think there may be a bug in here. But while we’re at it, it would be super cool to be able to lock an axis of the joystick for scenarios like this. I like the big fat control and autoreturn, but I only need a single axis for my scenario.

Not the world’s worst bug, but thanks anyway for looking into it!

Leave that disabled… it is a form of Data Mapping and may be influencing your actual values.

I would even consider disabling this, unless you really need it… or at least while testing, as it will change the readings, but without showing any visual clues in the UI (aside from the small values in the upper right corner)… so how you hold your phone/tablet could be adding to your interpretation or an error??

It is just acknowledging the horizontal position (it will always show both axis), but if you don’t even have a pin assigned, then that is meaningless to your sketch anyhow so can be disregarded by you as well.

Thanks for the quick reply. I’ve disabled the data mapping and disabled rotate on tilt and will look out for future occurrences of this issue.

In all of my testing, I’ve been using a tablet held vertically in a tablet holder mounted to my desk at a vertical angle (tablet nearly perpendicular to the ground) so it doesn’t seem likely that the accelerator was confused. But I can’t totally rule that out either - it would be a logical explanation.

Thanks again and I’ll keep you posted.