Error when i compile sketch



  • When I want to compile the sketch so send sensor data to my RPi i get this error:
    BinarySwitchSensor:14: error: 'Bounce' does not name a type
    BinarySwitchSensor.ino: In function 'void setup()':
    BinarySwitchSensor:27: error: 'debouncer' was not declared in this scope
    BinarySwitchSensor.ino: In function 'void loop()':
    BinarySwitchSensor:40: error: 'debouncer' was not declared in this scope
    What can i do?


  • Admin

    @eliabieri

    You have probably just missed to add the libraries.



  • No, I added them! Under Examples I can see the library.
    But theres something wrong with the include of the Bounce2.h, Sensor.h and RF24.h. They dont change to orange like EEPROM.h and SPI.h does.
    Its the same problem in every example sketch


  • Admin

    @eliabieri

    Hmm... something is obviously wrong in your setup. Did you restart IDE after adding the libraries?



  • Yes I did!



  • I found the solution.
    I copied all the libraries directly to the libraries folder of the Arduino IDE
    now it works!


  • Hero Member

    I did that too, for arduino 1.0.1 under debian 7.5:

    In file included from /usr/share/arduino/libraries/RF24/RF24.h:788:0,
    from SerialGateway.cpp:26:
    /usr/share/arduino/libraries/RF24/RF24.c:27:21: fatal error: spi/spi.h: Aucun fichier ou dossier de ce type
    compilation terminated.

    when downloading 1.0.5 (following) I have:
    SerialGateway.ino:31:25: fatal error: avr/progmem.h: Aucun fichier ou dossier de ce type

    when running 1.5.6r2 or nightly I have:

    SerialGateway:41: error: ‘Gateway’ does not name a type
    SerialGateway:44: error: ‘MAX_RECEIVE_LENGTH’ was not declared in this scope
    SerialGateway.ino: In function ‘void setup()’:
    SerialGateway:50: error: ‘gw’ was not declared in this scope
    SerialGateway:57: error: ‘MsTimer2’ has not been declared
    SerialGateway:58: error: ‘MsTimer2’ has not been declared
    SerialGateway:60: error: ‘PCintPort’ has not been declared
    SerialGateway.ino: In function ‘void loop()’:
    SerialGateway:66: error: ‘gw’ was not declared in this scope
    SerialGateway.ino: In function ‘void startInclusionInterrupt()’:
    SerialGateway:73: error: ‘gw’ was not declared in this scope
    SerialGateway.ino: In function ‘void ledTimersInterrupt()’:
    SerialGateway:77: error: ‘gw’ was not declared in this scope
    SerialGateway.ino: In function ‘void checkSerialInput()’:
    SerialGateway:84: error: ‘gw’ was not declared in this scope
    SerialGateway:84: error: ‘inputString’ was not declared in this scope
    SerialGateway.ino: In function ‘void serialEvent()’:
    SerialGateway:102: error: ‘MAX_RECEIVE_LENGTH’ was not declared in this scope
    SerialGateway:104: error: ‘inputString’ was not declared in this scope
    SerialGateway:108: error: ‘inputString’ was not declared in this scope


  • Hero Member

    Hello,

    good news, it works but here is the solution:

    • ide 10.3 to 1.0.5 fails to work.

    • 1.5.6r2 works but the sketch directory is now called Arduino, and then it works...just select port to ttyACM0 and not COM1 !


Log in to reply
 

Suggested Topics

  • 3
  • 2
  • 2
  • 1
  • 24
  • 1

1
Online

11.2k
Users

11.1k
Topics

112.5k
Posts