1

I downloaded Arduino code from this: https://github.com/BabyWrassler/MissionControl/ Github, and got the error message below.

It is designed to work with a Raspberry Pi, and I installed the two Adafruit libraries. I also have not hooked it up to either the Pi, or the two Adafruit devices, but that is partly because I cannot get it to run without the error message.

Update: Here is what was highlighted: Adafruit_LEDBackpack matrixA = Adafruit_LEDBackpack(); The orange bar says: Variable or field ‘matrixOff‘ declared void I cannot tell what of the following was from before, but here is the entire console log:

    mcDesk.ino:2:53: error: Adafruit_LEDBackpack.h: No such file or directory
    mcDesk.ino:3:45: error: Adafruit_GFX.h: No such file or directory
    mcDesk:11: error: variable or field 'matrixOff' declared void
    mcDesk:11: error: 'Adafruit_LEDBackpack' was not declared in this scope
    mcDesk:11: error: expected primary-expression before 'buffer'
    mcDesk:12: error: variable or field 'ledOn' declared void
    mcDesk:12: error: 'Adafruit_LEDBackpack' was not declared in this scope
    mcDesk:12: error: expected primary-expression before 'buffer'
    mcDesk:12: error: expected primary-expression before 'cat'
    mcDesk:12: error: expected primary-expression before 'an'
    mcDesk:13: error: variable or field 'ledOff' declared void
    mcDesk:13: error: 'Adafruit_LEDBackpack' was not declared in this scope
    mcDesk:13: error: expected primary-expression before 'buffer'
    mcDesk:13: error: expected primary-expression before 'cat'
    mcDesk:13: error: expected primary-expression before 'an'
    mcDesk:14: error: variable or field 'dispMat' declared void
    mcDesk:14: error: 'Adafruit_LEDBackpack' was not declared in this scope
    mcDesk:14: error: expected primary-expression before 'buffer'
    mcDesk:17: error: variable or field 'threeDigitDisp' declared void
    mcDesk:17: error: 'Adafruit_LEDBackpack' was not declared in this scope
    mcDesk:17: error: expected primary-expression before 'buffer'
    mcDesk:17: error: expected primary-expression before 'cats'
    mcDesk:17: error: expected primary-expression before 'ans'
    mcDesk:17: error: expected primary-expression before 'number'
    mcDesk:18: error: variable or field 'digitDisp' declared void
    mcDesk:18: error: 'Adafruit_LEDBackpack' was not declared in this scope
    mcDesk:18: error: expected primary-expression before 'buffer'
    mcDesk:18: error: expected primary-expression before 'pos'
    mcDesk:18: error: expected primary-expression before 'cat'
    mcDesk:18: error: expected primary-expression before 'an'
    mcDesk:18: error: expected primary-expression before 'num'
    mcDesk:23: error: variable or field 'switchBars' declared void
    mcDesk:23: error: 'Adafruit_LEDBackpack' was not declared in this scope
    mcDesk:23: error: expected primary-expression before 'buffer'
    mcDesk:23: error: expected primary-expression before 'grphCats'
    mcDesk:23: error: expected primary-expression before 'grphAns'
    mcDesk:23: error: expected primary-expression before 'cmnd'
    mcDesk:23: error: expected primary-expression before 'offset'
    mcDesk:24: error: variable or field 'barDisp' declared void
    mcDesk:24: error: 'Adafruit_LEDBackpack' was not declared in this scope
    mcDesk:24: error: expected primary-expression before 'buffer'
    mcDesk:24: error: expected primary-expression before 'grphCats'
    mcDesk:24: error: expected primary-expression before 'grphAns'
    mcDesk:24: error: expected primary-expression before 'pos'
    mcDesk:24: error: expected primary-expression before 'offset'
    mcDesk:25: error: variable or field 'cBarDisp' declared void
    mcDesk:25: error: 'Adafruit_LEDBackpack' was not declared in this scope
    mcDesk:25: error: expected primary-expression before 'buffer'
    mcDesk:25: error: expected primary-expression before 'grphCats'
    mcDesk:25: error: expected primary-expression before 'grphAns'
    mcDesk:25: error: expected primary-expression before 'pos'
    mcDesk:25: error: expected primary-expression before 'offset'
    mcDesk:11: error: 'Adafruit_LEDBackpack' does not name a type
    mcDesk:12: error: 'Adafruit_LEDBackpack' does not name a type
    mcDesk:13: error: 'Adafruit_LEDBackpack' does not name a type
    mcDesk:14: error: 'Adafruit_LEDBackpack' does not name a type
    mcDesk:15: error: 'Adafruit_LEDBackpack' does not name a type
    mcDesk.ino: In function 'void decodeCommand()':
    mcDesk:193: error: 'matrixE' was not declared in this scope
    mcDesk:193: error: 'ledOn' was not declared in this scope
    mcDesk:199: error: 'matrixE' was not declared in this scope
    mcDesk:199: error: 'ledOff' was not declared in this scope
    mcDesk:204: error: 'matrixC' was not declared in this scope
    mcDesk:204: error: 'cBarDisp' was not declared in this scope
    mcDesk.ino: In function 'void allMatrixOff()':
    mcDesk:213: error: 'matrixA' was not declared in this scope
    mcDesk:213: error: 'matrixOff' was not declared in this scope
    mcDesk:214: error: 'matrixB' was not declared in this scope
    mcDesk:215: error: 'matrixC' was not declared in this scope
    mcDesk:216: error: 'matrixD' was not declared in this scope
    mcDesk:217: error: 'matrixE' was not declared in this scope
    mcDesk.ino: At global scope:
    mcDesk:220: error: variable or field 'matrixOff' declared void
    mcDesk:220: error: 'Adafruit_LEDBackpack' was not declared in this scope
    mcDesk:220: error: expected primary-expression before 'buffer'
  • "Adafruit_LEDBackpack not declared" tells me maybe the library wasn't installed? Can you run one of the examples in that library? (File > Examples) – sachleen Mar 15 '14 at 20:12
  • @sachleen which one? Does it matter? – AwesomeUser Mar 15 '14 at 23:48
  • Printscreen is far clearer than taking a picture of the screen. Also put all of your code up on pastebin. – Cybergibbons Mar 16 '14 at 0:06
  • @cybergibbons sorry, I was using my iPad to make the post. My Arduino computer doesn't have wifi on it. – AwesomeUser Mar 16 '14 at 0:08
  • Copy and paste the messages from the text below the code window, as well as the code section that has the error in it (the highlighted section). Try not to post images of code or error messages, when it is in plain text. – asheeshr Mar 16 '14 at 2:39
4

It seems to me that those Adafruit libraries were not correctly installed on your PC or your sketch.

In addition to downloading and installing the library onto the Arduino library directory (on Windows, that's normally C:\Users\UserName\Documents\Arduino\libraries), when you want to use that library with Arduino IDE, you must add the library for your sketch with the menu command "Sketch -> Import Library..."

Important note: it seems just adding #include "library.h" does not work with Arduino IDE, you absolutely need to use the menu.

  • 1
    I don't think I've ever used the menu to include a library - it definitely works just typing it in here. – Cybergibbons Mar 16 '14 at 10:27
  • @Cybergibbons I faced that problem a couple of times in the past (I almost never use Arduino IDE anymore though, except for quick qnd dirty proofs of concept), that's why I mentioned it here. – jfpoilpret Mar 16 '14 at 10:32
  • Interesting. The more I use the Arduino IDE, the more I dislike it. – Cybergibbons Mar 16 '14 at 10:34
  • I tried that, but still got the exact same error message. @cybergibbons + jfproilpret – AwesomeUser Mar 16 '14 at 20:41
  • 2
    Installing external libraries can be a mess, I suggest trying biicode (docs) that downloads and configures them for you. Your required libraries are here: adafruit and the firmware is here mission control you can try with bii open babywrassler/missioncontrol to download it along with adafruit requirements – user93 Mar 17 '14 at 11:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.