I'm fairly new to the Zero but can't seem to get the CapacitiveSensor library to compile for the Zero.
Any suggestions are appreciated.
Currently getting:
Arduino: 1.6.6 (Mac OS X), Board: "Arduino/Genuino Zero (Programming Port)"
Warning: platform.txt from core 'Arduino SAMD (32-bits ARM Cortex-M0+) Boards' contains deprecated recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}", automatically converted to recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}". Consider upgrading this core.
In file included from /Users/ckey/Documents/projects/structure/arduino-capsense/capsense_test/capsense_test.ino:1:0:
/Users/ckey/Documents/Arduino/libraries/CapacitiveSensor/CapacitiveSensor.h:97:2: error: 'IO_REG_TYPE' does not name a type
IO_REG_TYPE sBit; // send pin's ports and bitmask
^
/Users/ckey/Documents/Arduino/libraries/CapacitiveSensor/CapacitiveSensor.h:98:11: error: 'IO_REG_TYPE' does not name a type
volatile IO_REG_TYPE *sReg;
^
/Users/ckey/Documents/Arduino/libraries/CapacitiveSensor/CapacitiveSensor.h:99:2: error: 'IO_REG_TYPE' does not name a type
IO_REG_TYPE rBit; // receive pin's ports and bitmask
^
/Users/ckey/Documents/Arduino/libraries/CapacitiveSensor/CapacitiveSensor.h:100:11: error: 'IO_REG_TYPE' does not name a type
volatile IO_REG_TYPE *rReg;
^
exit status 1
Error compiling.
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Failing that, you could try to contact Paul Stoffregen on the PJRC forum. Paul wrote the non-AVR support for this library and is also the creator of the PJRC's Teensy boards.
Capacitive sensor "hacks" tend to be very chip-specific, since they typically rely on the analog behavior of the digital IO pins. I wouldn't really expect the AVR library to work on the ARM chips even if you DID convery the low-level primitives correctly.
OTOH, the SAMD21 processor used on the Zero has a built-in Touch Controller interface...
The #defines in #2 do not work. I put them into CapacitiveSensor.h anyway with a comment, as a starting point for someone to hopefully contribute a fix.
I know this is an old thread but I have found a library made by Adafruit which is compatible with ARM
devices (I tried it on a feather m0 express and responded well). it's called Adafruit_FreeTouch.
Is there any way to mix both? I kinda like the CapacitiveSensor library better.