I am using an adafruit feather 32u4 board. I downloaded the Adafruit BluefruitLE nRF51 library. Once installed I copied and pasted the installation tab code into the .ini file. Now when I try to compile I receive this environment error.
The second environment makes no sense. An infineonxmc environment with no board set, and the library added three times with different versioning styles? Maybe you miscopied it from the examples, but I think you should just delete that part.
The board page (Overview | Adafruit Feather 32u4 Bluefruit LE | Adafruit Learning System) to use the Adafruit BluefruitLE nRF51 library, so you’re good with that one. Note that you also have to include the library in your source code to have it compoile properly. Easiest to take the example files
but rename the .ino to just .cpp. Compiling then gives me
RAM: [== ] 19.2% (used 492 bytes from 2560 bytes)
Flash: [=== ] 32.5% (used 9320 bytes from 28672 bytes)
Building .pio\build\feather32u4\firmware.hex
============ [SUCCESS] Took 7.64 seconds ============
The .ino to .cpp conversion requires for that file that you predaclare the used functinos, just like the the FAQ says.
// after all #include lines
void getUserInput(char buffer[], uint8_t maxSize);
If you just want to do a quick test and don’t plan to change or add on the code, you can also keep the .ino extension, PlatformIO will autoconvert it to .cpp on compilation.
RAM: [== ] 16.1% (used 412 bytes from 2560 bytes)
Flash: [=== ] 32.3% (used 9254 bytes from 28672 bytes)
Building .pio\build\feather32u4\firmware.hex
============ [SUCCESS] Took 5.87 seconds ============
But after removing the 2nd part of the .ini file I am getting include errors. So how can I only run the atcommand example from the library after installing it to my project?
Have you made sure to use the project environment switcher to select the first environment again? It will show “Reloading tasks” for a while when it’s downloading the lib into that environment, then all include errors should be gone…
Once you add a library via lib_deps you must include it in your main source file so that the library’s dependencies are found correctly. So your initial includes should look like
Ok thanks, I switched to platformio because arduino ide did not accept my feather 32u4, so I am new to how this works and you have been a life saver for my project!