Include Arduino library in non-DaisyDuino program

Hello -

I’m trying to build a program for the Seed to run from QSPI so that it can be loaded via the bootloader.

I’m transitioning from DaisyDuino and am wondering if there is a method to use an existing Arduino library (this one: GitHub - adafruit/Adafruit-PN532: Arduino library for SPI and I2C access to the PN532 RFID/Near Field Communication chip) in a non-DaisyDuino program.

I tried to update my includePath in VSCode to accommodate all of the Arduino-related dependencies, but ran into two issues:

  • I was not able to find the Arduino core libraries in the package contents of the Arduino IDE app (v2.3.6)
  • I tried downloading the Arduino core libraries [here] (GitHub - arduino/ArduinoCore-avr: The Official Arduino AVR core) and adding the whole folder to IntelliSense, but was met with further , deeper dependency issues.

Should I take a different approach? The PN532 module I’m using is essential to my project, so I just need some way to interface with it, but I’ve only been able to find Arduino-specific libraries.

It’s also essential that I use the bootloader, not DaisyDuino, so that the end user can update their firmware via USB Drive.

I’m a newbie so any suggestions / advice are helpful.

Thanks in advance, and let me know if this post belongs in a different thread.

Update: I have located the necessary Arduino dependencies by turning on Verbose Output in the Arduino IDE.

Now Intellisense sees all necessary dependencies, but when I try to compile with the make command, the compiler tells me that Adafruit_PN532.h does not exist, even though Intellisense is able to see it and link to the definition.

I may be missing something… the program compiles fine if I don’t include this library. It is able to find “daisy_seed.h” and “daisysp.h”. I’m just adding #include "Adafruit_PN532" to the example oscillator program. I’m not actually attempting to use this library in the program yet, just testing to see if it will compile.

After some research it seems like the answer may lie in tasks.json, but I’m unsure whether I actually need to manually tell the compiler where to look if Intellisense already knows, and the compiler is able to find “daisy_seed.h” and “daisysp.h” without editing tasks.json.

Further, to manually specify an include path in tasks.json it seems I need to add to the “args”, yet I see no “args” at all in the default tasks.json file associated with the example Oscillator program

Intellisense is completely separate from what is needed to compile the program. Intellisense is used by the editor, not by the compiler.
The Makefile is where you would make changes to what files are compiled, and where they are found.

If I were trying to use this code in a C++ Daisy program, I’d copy the files ( Adafruit_PN32.cpp , Adafruit_PN32.h ) into my project directory, edit the Makefile to tell it to build and link the code, then start hacking them to eliminate dependencies to other Adafruit code.

Frankly, this isn’t beginner stuff.

Thanks for your reply.

I’m going to stick to DaisyDuino for now as I learn more about C++.

As a workaround, so that the end user can still easily update, I’m using a resetToBootloader function (BOOT_FLASH attached to a pin? - #18 by infrasonicaudio), which will allow for a compiled binary (from Arduino IDE) to be flashed via the daisy web programmer.