1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2025-02-19 23:46:02 +01:00

12-bit analog, vs just 10-bit

This commit is contained in:
travis-farmer 2023-11-12 04:44:59 -05:00
parent 98f00300ec
commit 83a22dfae5
No known key found for this signature in database
GPG Key ID: 0BC296791D14CB35

View File

@ -145,7 +145,7 @@ int * ADCee::analogvals = NULL;
int16_t ADCee::ADCmax()
{
return 1023;
return 4095;
}
AdvancedADC adc;
@ -155,8 +155,8 @@ int num_active_pins = 4;
const int samples_per_round = 512;
int ADCee::init(uint8_t pin) {
adc.stop();
if (pin >= A0 && pin <= A3) adc.begin(AN_RESOLUTION_10, 16000, 1, samples_per_round, num_active_pins, active_pins);
else if (pin >= A4 && pin <= A7) adc.begin(AN_RESOLUTION_10, 16000, 1, samples_per_round, num_active_pins, active_pinsB);
if (pin >= A0 && pin <= A3) adc.begin(AN_RESOLUTION_12, 16000, 1, samples_per_round, num_active_pins, active_pins);
else if (pin >= A4 && pin <= A7) adc.begin(AN_RESOLUTION_12, 16000, 1, samples_per_round, num_active_pins, active_pinsB);
return 123;
}