mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2024-11-24 08:36:14 +01:00
so far, 8 good signals, one (tested) is DC
This commit is contained in:
parent
904fd5a780
commit
9a6a305fc5
|
@ -152,11 +152,11 @@ AdvancedADC adc;
|
|||
pin_size_t active_pins[] = {A0, A1, A2, A3};
|
||||
pin_size_t active_pinsB[] = {A4, A5, A6, A7};
|
||||
int num_active_pins = 4;
|
||||
const int samples_per_round = 3;
|
||||
const int samples_per_round = 512;
|
||||
int ADCee::init(uint8_t pin) {
|
||||
adc.stop();
|
||||
if (pin >= A0 && pin <= A3) adc.begin(AN_RESOLUTION_16, 2, 1, samples_per_round, num_active_pins, active_pins);
|
||||
else if (pin >= A4 && pin <= A7) adc.begin(AN_RESOLUTION_16, 2, 1, samples_per_round, num_active_pins, active_pinsB);
|
||||
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);
|
||||
return 123;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user