TrueOpenVR / TrueOpenVR-DIY

DIY VR devices
97 stars 10 forks source link

Use analog stick? #6

Closed Artemiy-Z closed 3 years ago

Artemiy-Z commented 3 years ago

How can i modify your code to work with analog stick?

r57zone commented 3 years ago

https://github.com/TrueOpenVR/TrueOpenVR-DIY/blob/master/Controllers/Arduino/Controller.ino#L87-L98 We read the analog value of the stick on the Arduino, it seems it is 0 to 1023, we convert it to the range from -1 to 1.

Artemiy-Z commented 3 years ago

So, can it be in float type?

r57zone commented 3 years ago

Yep

Artemiy-Z commented 3 years ago

Okay, thanks