Electronics
DIT Adafruit Feather Library
During the tutorials (and maybe later for "real" applications) there is some information that is needed by several applications and some tasks that are common to them.
To avoid having to reimplement or copy this code all the time, it is common practice to create library files and reference those whenever needed in a project.
I created a couple of library files for working with the Adafruit FeatherM0, while writing the tutorials.
You can find these files in the root directory of the solution (.c
and .h
files starting with Adafruit_FeatherM0_*
).
Feel free to use them in your own projects, if you find them useful.
Adafruit_FeatherM0_LED | Driving the FeatherM0 on-board LED |
Adafruit_FeatherM0_RS232 | Running RS232 communication over the FeatherM0 TX and RX header pins JP1.2 and JP1.3 |
Using the DIT Adafruit Feather library
All you have to do is:
- Add the path where the header
.h
files are to the include search path of you project - Add links to the implementation
.c
files to your project on project level (or you will get linker errors)
To add the .h
file path to the include search path of you project:
- Right-Click on you project (e.g.
'01_Blink'
) - Select
Properties
- Select
Toolchain
- Select
ARM/GNU C Compiler | Directories
- Find the
Add Item
button and press it - In the
Add Include Paths (-I)
dialog browse for the path theAdafruit_FeatherM0_*.h
files are stored in (in my case relative "../..
")
To link one or more .c
files to the project:
- Right-Click on you project (
'01_Blink'
) - Select
Add | Existing Item... Shift+Alt+A
- In the
Add Existing Item
dialog select the*.c
files you want to add to the project - Select
Add As Link
For me, using AtmelStudio 7.0.1417, this only works when the library files are linked in on project level.
But other people, using other versions, apparently had the same problem (see here for details).