31
Adding Custom Library Files
Adding own developed libraries to a project is key requirement for any software developer. This is
because no compiler includes libraries for all hardware. We must realize a compiler as a tool only. The
rest is how we use it and what we do with it. As for example, CCS comes with _delay_cycles instead
of more commonly preferred delay_ms or delay_us functions. We will, thus, need software delay
library. We need to code it and include it in our projects.
Custom libraries can be included in two ways. The easiest way is to add the include and source files in
your projects root location, i.e. its folder. No additional job is needed because the root contains the
main.c source file and its location is automatically included when you start a project.
However, the aforementioned method becomes clumsy and unprofessional when there are too many
custom library files in a large project and if you care for some neatness. The other method needs some
additional tasks to be done before we can use our library files.
First make a folder in your project directory and give it a name. For example, I named this folder
Libraries in my examples.
Next add the desired library source and header files in this folder.