Skip to content

targets/sg48key, sgh60: fix joystick center drift - #78

Merged
sago35 merged 1 commit into
mainfrom
fix-adc
Jul 13, 2026
Merged

targets/sg48key, sgh60: fix joystick center drift#78
sago35 merged 1 commit into
mainfrom
fix-adc

Conversation

@sago35

@sago35 sago35 commented Jul 13, 2026

Copy link
Copy Markdown
Owner

ADCDevice.Get2 assigned the raw value to a 2048-wide zone by flooring, so zone 0 covered only [0, 2047] - entirely on the positive side of true center - and the dead zone extended one zone (2048 counts) further in the positive direction than in the negative one. The stick therefore registered movement much earlier in one direction, observed as a slight drift near center. Add half a zone before shifting so the assignment rounds to the nearest zone and the dead zone becomes symmetric.

Both targets carry the same copy of ADCDevice; confirmed on sg48key hardware.

ADCDevice.Get2 assigned the raw value to a 2048-wide zone by flooring,
so zone 0 covered only [0, 2047] - entirely on the positive side of true
center - and the dead zone extended one zone (2048 counts) further in the
positive direction than in the negative one. The stick therefore
registered movement much earlier in one direction, observed as a slight
drift near center. Add half a zone before shifting so the assignment
rounds to the nearest zone and the dead zone becomes symmetric.

Both targets carry the same copy of ADCDevice; confirmed on sg48key
hardware.
@sago35
sago35 merged commit cf173e9 into main Jul 13, 2026
1 check passed
@sago35
sago35 deleted the fix-adc branch July 13, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant