Is there a simple way to use libraries intended for the Arduino IDE with the C and assembly code I write for AVR-G++/AVR-GCC?
I'm trying to use the Adafruit Wave Shield library , but simply including the header and cpp files don't do much good. Can I compile it somehow and link it to my C code? Or perhaps just find a way to make it compile with my C code.
Currently, when I try to do something simple like:
#include "WaveHC/WaveHC.h"
SdReader card;
card.init();
I am greeted with:
70: undefined reference to `SdReader::init(unsigned char)'
You can build the Arduino code with CMake . I have built largish Arduino projects without using the IDE this way. You can use whatever tools you want to build the Arduino code, it is just a C/C++ library. You mainly need to make sure you have all of the preprocessor settings right (F_CPU? Maybe some others).
Build using Cmake might help you. Basically, I would make a library file for the Arduino library, a library file for the shield library, and an EXE file for your code.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.