Skip to content

fix: only use ads if there is any pedal configured as ADS #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions PedalBox/Pedals.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ class Pedals {
Pedals::loadEEPROMSettings();
_joystick.begin();

_ads1015.begin();
_ads1015.setGain(0); // 6.144 volt
_ads1015.setDataRate(7); // fast
_ads1015.setMode(0); // continuous mode
if ((_clutch_pedalType == "ADS")
|| (_throttle_pedalType == "ADS")
|| (_brake_pedalType == "ADS")) {
_ads1015.begin();
_ads1015.setGain(0); // 6.144 volt
_ads1015.setDataRate(7); // fast
_ads1015.setMode(0); // continuous mode
}

_joystick.setRxAxis(0);
_joystick.setRxAxisRange(0, (_throttle_hid_bit - 1));
Expand Down