diff --git a/DCCTimerSAMD.cpp b/DCCTimerSAMD.cpp index 337b1bf..19684b2 100644 --- a/DCCTimerSAMD.cpp +++ b/DCCTimerSAMD.cpp @@ -56,7 +56,7 @@ void DCCTimer::begin(INTERRUPT_CALLBACK callback) { ADC->CTRLB.reg &= 0b1111100011111111; // mask PRESCALER bits ADC->CTRLB.reg |= ADC_CTRLB_PRESCALER_DIV64 | // divide Clock by 64 - ADC_CTRLB_RESSEL_12BIT; // Result on 12 bits + ADC_CTRLB_RESSEL_10BIT; // Result on 10 bits default, 12 bits possible ADC->AVGCTRL.reg = ADC_AVGCTRL_SAMPLENUM_1 | // take 1 sample at a time ADC_AVGCTRL_ADJRES(0x00ul); // adjusting result by 0 diff --git a/MotorDrivers.h b/MotorDrivers.h index accddf1..74aab48 100644 --- a/MotorDrivers.h +++ b/MotorDrivers.h @@ -50,8 +50,8 @@ // PMA - senseFactor for 3.3v systems is 1.95 as calculated when using 10-bit A/D samples, // and for 12-bit samples it's more like 0.488, but we probably need to tweak both these #define STANDARD_MOTOR_SHIELD F("STANDARD_MOTOR_SHIELD"), \ - new MotorDriver(3, 12, UNUSED_PIN, 9, A0, 0.488, 2000, UNUSED_PIN), \ - new MotorDriver(11, 13, UNUSED_PIN, 8, A1, 0.488, 2000, UNUSED_PIN) + new MotorDriver(3, 12, UNUSED_PIN, 9, A0, 1.95, 2000, UNUSED_PIN), \ + new MotorDriver(11, 13, UNUSED_PIN, 8, A1, 1.95, 2000, UNUSED_PIN) #else #define STANDARD_MOTOR_SHIELD F("STANDARD_MOTOR_SHIELD"), \ new MotorDriver(3, 12, UNUSED_PIN, 9, A0, 2.99, 2000, UNUSED_PIN), \