windowscompiler-errorslibrariesarduino-ideintel-galileo

Can't compile CapacitiveSensor example in Arduino


I am trying to use the Capacitive Sensors Library from the Arduino Playground with Arduino 1.5.3 for Intel Galileo.

While trying to compile the example Sketch of the library with nothing touched I get the following error:

Arduino: 1.5.3 (Windows 7), Board: "Intel® Galileo"

CapacitiveSensor.cpp: In constructor 'CapacitiveSensor::CapacitiveSensor(uint8_t, uint8_t)': CapacitiveSensor.cpp:30:63: error: 'F_CPU' was not declared in this scope CapacitiveSensor.cpp:43:10: error: 'PinDescription' has no member named 'ulPin' CapacitiveSensor.cpp:44:10: error: 'PinDescription' has no member named 'pPort' CapacitiveSensor.cpp:45:31: error: 'portModeRegister' was not declared in this scope CapacitiveSensor.cpp:46:9: error: base operand of '->' is not a pointer CapacitiveSensor.cpp:48:9: error: 'PinDescription' has no member named 'ulPin' CapacitiveSensor.cpp:49:10: error: 'PinDescription' has no member named 'pPort' CapacitiveSensor.cpp:51:9: error: base operand of '->' is not a pointer CapacitiveSensor.cpp:52:12: error: base operand of '->' is not a pointer CapacitiveSensor.cpp:55:18: error: 'noInterrupts' was not declared in this scope CapacitiveSensor.cpp:57:16: error: 'interrupts' was not declared in this scope CapacitiveSensor.cpp: In member function 'void CapacitiveSensor::set_CS_Timeout_Millis(long unsigned int)': CapacitiveSensor.cpp:133:73: error: 'F_CPU' was not declared in this scope CapacitiveSensor.cpp: In member function 'int CapacitiveSensor::SenseOneCycle()': CapacitiveSensor.cpp:141:18: error: 'noInterrupts' was not declared in this scope CapacitiveSensor.cpp:151:16: error: 'interrupts' was not declared in this scope

I downloaded the files and imported the "CapacitiveSensor"-Folder into (I did those steps one after the other, not at the same time.):

  1. The libraries folder under Documents/arduino/.
  2. The libraries folder in the arduino folder where the arduino.exe is stored.
  3. Onto arduino-1.5.3/hardware/libraries/ (because this is mentioned on the site where I downloaded it)
  4. And I tried this: Here Because it seemed to be the same error as I had. But it didnt work.

I also deleted my Arduino and reinstalled it.

Anyone has an Idea? Thanks in advance, Clemens


Solution

  • There is a similar question on the Arduino forum but I don't know if your issue is exactly the same: [FIXED][CapacitiveSensor] Can't compile with Due (port manipulation)

    It doesn't look like the Arduino folks are very responsive. The user modified register names and eventually put his own library out there.

    *"...changed the uint8_t registers to RwReg (compiler doesn't complain) and I replaced the use of portModeRegister(PIN) with simple pinMode(PIN, MODE) calls (it's slower but it works)."*