Automatic Magnetic Loop Tuner – Arduino 1.8.11 & Teensyduino 1.50

I just installed the latest version of Arduino: 1.8.11 and Teensyduino 1.50.

When compiling the latest version ML_v409 I got the the following error:

ML_v409:1287: error: 'class ADC' has no member named 'setSamplingSpeed'
adc->setSamplingSpeed(ADC_SAMPLING_SPEED::LOW_SPEED); // Sampling speed, ADC_VERY_LOW_SPEED, ADC_LOW_SPEED, ADC_MED_SPEED, ADC_HIGH_SPEED or ADC_VERY_HIGH_SPEED

Apparently something changed in the ADC.h library so we need to change the following code:

// Set up the two separate ADCs for synchronous read at 12 bit resolution and lowest possible measurement speed (minimal noise)

adc->setSamplingSpeed(ADC_SAMPLING_SPEED::LOW_SPEED);
adc->setSamplingSpeed(ADC_SAMPLING_SPEED::LOW_SPEED, ADC_1);
adc->setConversionSpeed(ADC_CONVERSION_SPEED::LOW_SPEED);
adc->setConversionSpeed(ADC_CONVERSION_SPEED::LOW_SPEED, ADC_1);
adc->setResolution(12);
adc->setResolution(12, ADC_1);
adc->setAveraging(16);
adc->setAveraging(16, ADC_1);

  to this:

 // Set up the two separate ADCs for synchronous read at 12 bit resolution and lowest possible measurement speed (minimal noise)
adc->adc0->setSamplingSpeed(ADC_SAMPLING_SPEED::LOW_SPEED);
adc->adc1->setSamplingSpeed(ADC_SAMPLING_SPEED::LOW_SPEED);
adc->adc0->setConversionSpeed(ADC_CONVERSION_SPEED::LOW_SPEED);
adc->adc1->setConversionSpeed(ADC_CONVERSION_SPEED::LOW_SPEED);
adc->adc0->setResolution(12);
adc->adc1->setResolution(12);
adc->adc0->setAveraging(16);
adc->adc1->setAveraging(16);

Then recompile again and you are good to go!
This info was also already shared in the LoopController group on Groups.io

73 de ON5IA
Frederik

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.