Joystick widget

No, it doesn’t work for what it needs to do… For this application, the widget has to give me full control of both axes simultaneously. I cannot achieve maximum rudder deflection while adjusting speed, nor can I achieve maximum speed while turning. No amount of math or extrapolation can determine how each axis value behaves, when physically the joystick “path” is constrained.

So, it seems as this suggestion for a square joystick widget is not even making it to the bottom of a list, and therefore I must continue my search for another platform to work with. Blynk is not for me, at least not on this project…

EDIT: If it ever does make it to the wish list, there is something else I would want the widget to allow… Auto-return to centre as separate configurations for either axis. On an R/C flight controller, for example, the throttle/rudder controls are on the left stick (Mode 2), and the aileron/elevator controls are on the right stick. All the controls have auto-return, except the throttle, and all of the X/Y movements are 100% independent, because the stick is allowed a square path.

I’m going to eat humble pie (pun intended)…

It seems that I can do what I want, and it is based on Pavel’s excellent drawing of the square in the circle.

Say I want each axis to be -1000 to 1000, all I have to do is set the joystick min and max at +/- 1414 (pythagoras : SQRT(1000^2 + 1000^2)), and then in my sketch “constrain” the values to +/- 1000. That actually gives me “square” co-ordinates, and the x/y values become independent. the 45 degree joystick x/y positions (going clockwise from top left) give the values -1000/+1000, +1000/+1000, +1000/-1000, and -1000/-1000.

The “constraints” remove the segments of the circle that were causing me so much grief.

Now if only the “auto-return” could be applied independently to each axis, it would be near-perfect !!

Thanks for a constructive discussion guys…

2 Likes

Well, it is exactly the constrain() function you need to use. A basic Arduino mapping function (one of two, I think). Glad you “forced” you thoughts into that direction. :wink:

Yes, as stated for the needs that this App is designed for, any “loss” of resolution is negligible :wink:

And again, this can be tweaked with code :stuck_out_tongue_winking_eye: just send your positioning command back to the Joystick widget with BlynkvirtualWrite();

In fact you can even integrate trim controls if you wanted.

1 Like

As part of a separate project of mine, I was recently able to get an old PS2 wired controller working with Arduino… and while playing about with all its buttons, I noticed that yes, even good old Sony joysticks only register around 18 (from 0) & 232 (out of 255) for both X/Y in the corners. So I guess if it is good enough for little old Sony, should be good nuf for Blynk :stuck_out_tongue_winking_eye:

Simply? doesn’t reflect the real joystick usage… I think that is so simple to add a new widget called REAL joystick.
This is only my idea. For example I migrate my TX RC Car to hardware, it will be less expensive and more accurate than blyink widget joystick.
In addition I think that 6000 euros to have a sellable apps on stores seem to be quite expensive for my company. I also had some problem with dynamic update value on iphone widget using bluetooth. Some strange things happens like have to mix bluetooth and wifi on app but not on sketch…