From 96ab535b8c41525429682c9df39618f5624bf504 Mon Sep 17 00:00:00 2001 From: Ayrton Ricardo Date: Wed, 26 Feb 2025 20:49:41 +0100 Subject: [PATCH] fix: only use ads if there is any pedal configured as ADS --- PedalBox/Pedals.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/PedalBox/Pedals.h b/PedalBox/Pedals.h index 0159185..4430519 100644 --- a/PedalBox/Pedals.h +++ b/PedalBox/Pedals.h @@ -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));