Android Question Dji Lybrary, Set Left and Right Stick

PABLO2013

Well-Known Member
Licensed User
Longtime User
Greetings I want to know if the movement of the right stick is possible by code, to program a movement controlled by code. i did this but it does not work



B4X:
Dim z3 As Int=600

Dim setLeft As JavaObject = HardwareState.RunMethod("setLeft", Null)

 If c1Clicked=True Then setLeft.RunMethod("setHorizontalPosition", Array(z3))

and i reviewed this:


https://github.com/dji-sdk/Mobile-SDK-iOS/issues/212
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

PABLO2013

Well-Known Member
Licensed User
Longtime User
Thanks DonMandred.
I was trying things that I need and I did this and it works.

B4X:
Dim HorizontalPosition As Int = LeftStick.RunMethod("getHorizontalPosition", Null)

If c2Clicked=True Then ToastMessageShow($"RightStick Value: ${HorizontalPosition}"$, False)

but not know, if this works and take it out of here (picture)



I do not know if this will move the drone, simulating virtule controls, if they exist ....

tks
 

Attachments

  • stick.png
    stick.png
    10.7 KB · Views: 150
Upvote 0
Top