Teensy 4.1 and CapacitiveSensor Type Error

Status
Not open for further replies.

emma_fw

Member
I'm getting the following three errors when trying to compile the CapacitiveSensorSketch example:

/Users/emma/Documents/Arduino/libraries/CapacitiveSensor/CapacitiveSensor.h:222:2: error: 'IO_REG_TYPE' does not name a type
IO_REG_TYPE sBit; // send pin's ports and bitmask
^
/Users/emma/Documents/Arduino/libraries/CapacitiveSensor/CapacitiveSensor.h:223:11: error: 'IO_REG_TYPE' does not name a type
volatile IO_REG_TYPE *sReg;
^
/Users/emma/Documents/Arduino/libraries/CapacitiveSensor/CapacitiveSensor.h:224:2: error: 'IO_REG_TYPE' does not name a type
IO_REG_TYPE rBit; // receive pin's ports and bitmask
^
/Users/emma/Documents/Arduino/libraries/CapacitiveSensor/CapacitiveSensor.h:225:11: error: 'IO_REG_TYPE' does not name a type
volatile IO_REG_TYPE *rReg;​

I've been able to use the capsense library and teensy 4.1 on a different computer with no problem. Not sure what's going wrong here..
I'm using a Mac with Arduino 1.8.15 and Teensyduino 1.54.
 
It works for me with MacOS and 1.53 and 1.54 - however its using the inbuilt CapacitiveSensor library - your trace shows a locally
installed version presumably is different from the one provided with Teensyduino.
 
Thanks for your response!
If I uninstall the CapacitiveSensor library I get an error that it does not exist. If there is an inbuilt library that comes with Teenysduino then my computer is not finding it.
 
Thanks for your response!
If I uninstall the CapacitiveSensor library I get an error that it does not exist. If there is an inbuilt library that comes with Teenysduino then my computer is not finding it.

How did you uninstall it?
 
Hmm, I don't have one and it compiles... BTW I'd temporarily hide a library by renaming it.

Do you have a directory called: /Applications/Teensyduino.app/Contents/Java/hardware/teensy/avr/libraries/CapacitiveSensor ?
 
I did not, so I moved the CapacitanceSensor from my Arduino folder to the Teensyduino one and got the same error as above ('IO_REG_TYPE' does not name a type)
 
I did not, so I moved the CapacitanceSensor from my Arduino folder to the Teensyduino one and got the same error as above ('IO_REG_TYPE' does not name a type)

You CANNOT just take code from the Arduino Folder (which has been written for Arduino) and pop it into the Teensyduino folder. The code in the Teensyduino folder should be written/optimised for Teensy's.

I suggest you re-install Teensyduino which will bring with it the relevant CapacitiveSensor library.

The resultant address of the library will be:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Capacitive\Sensor.
 
You CANNOT just take code from the Arduino Folder (which has been written for Arduino) and pop it into the Teensyduino folder. The code in the Teensyduino folder should be written/optimised for Teensy's.

I suggest you re-install Teensyduino which will bring with it the relevant CapacitiveSensor library.

The resultant address of the library will be:
C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Capacitive\Sensor.

I reinstalled Teensyduino and that fixed the problem, thank you!
 
Status
Not open for further replies.
Back
Top