ADCTouch Library on Uno WiFi R2

I'm trying to set up a capacitive sensor. I tried the CapacitiveSensor library by Paul Badger but found it unreliable and it would give readings when there was no touch. I then found the ADCTouch library by martin2250 which was exciting and seemed to work great. I tested it on my Uno and it worked perfectly.

Since my project uses communication via WiFi I then tried to upload the simple test sketch, Buttons.ini to my Uno WiFI R2 board. I immediately received the following errors.

"WARNING: library ADCTouch claims to run on avr architecture(s) and may be incompatible with your current board which runs on megaavr architecture(s)."

with additional errors:
/Arduino/libraries/ADCTouch/src/ADCTouch.cpp: In member function 'int ADCTouchClass::read(byte, int)':
/Arduino/libraries/ADCTouch/src/ADCTouch.cpp:31:3: error: 'ADMUX' was not declared in this scope
ADMUX |= 0b11111;
^~~~~
/Arduino/libraries/ADCTouch/src/ADCTouch.cpp:34:3: error: 'ADCSRA' was not declared in this scope
ADCSRA |= (1 << ADSC);
^~~~~~
/Arduino/libraries/ADCTouch/src/ADCTouch.cpp:34:3: note: suggested alternative: 'ADC_t'
ADCSRA |= (1 << ADSC);
^~~~~~
ADC_t
Arduino/libraries/ADCTouch/src/ADCTouch.cpp:34:19: error: 'ADSC' was not declared in this scope
ADCSRA |= (1 << ADSC);
^~~~
/Arduino/libraries/ADCTouch/src/ADCTouch.cpp:34:19: note: suggested alternative: 'DDRC'
ADCSRA |= (1 << ADSC);
^~~~
DDRC

What do I need to add to make this work as it does on the regular Uno board?

I did try an additional library called ADCTouchSensor by Alexander Pruss but I got the same errors.

Has anyone had similar experience or know a direction I could take to resolve the issue?
Thanks so much,

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.