nightmode / logitech-g29

Logitech G29 Racing Wheel for Node
Creative Commons Zero v1.0 Universal
106 stars 37 forks source link

leap of wheel turn value #13

Closed VladSalat666 closed 5 years ago

VladSalat666 commented 5 years ago

Hello

Could you add fix to lib?

If you will turn wheel slowly, you will observe leaps of wheel turn value, so I have fixed this issue Just change this code: wheelCourse = wheelCourse / 255 * 99 // 99 instead of 100 so wheelCourse and wheelFine add up to 100% when they are both maxed out wheelFine = wheelFine / 255

on

wheelCourse = wheelCourse / 255 * ( 100 - ( 100 / 256 )) // 99 instead of 100 so wheelCourse and wheelFine add up to 100% when they are both maxed out wheelFine = wheelFine / 255 * ( 100 / 256 ) // multiplied on this coefficient because of difference between an adjacent values is not 1

in the data-map.js

nightmode commented 5 years ago

Hi Vlad,

This sounds great. I will pull my wheel out of storage tomorrow to test. ^_^

VladSalat666 commented 5 years ago

I've created pull request with fix

nightmode commented 5 years ago

Pull request merged.

The wheel numbers have never looked so good. Thank you Vlad!

nightmode commented 5 years ago

I just made a 99% similar change to the logitech-g27 library for users of that older wheel system. Thanks again for not only reporting this issue but figuring out the fix for it too. Much appreciated. ^_^

VladSalat666 commented 5 years ago

You are welcome!😉