Go Down

Topic: Content of the Arduino library (Read 264 times) previous topic - next topic

ELohiiri

Hi,

For learning purposes I have created my first library which I use from the main code. I have created .h and .cpp files and everything works fine! Looking at the libraries others have created there seems to be also a file with .txt extension. Are there any guidelines what this file should contain and what is the format?

When developing the library, I tried to use in the .cpp file Serial.println() -command in debugging but failed. How I can use it in the library code?

Erkki

pert

there seems to be also a file with .txt extension. Are there any guidelines what this file should contain and what is the format?
Do you mean keywords.txt? That file is used to provide coloration of the library's keywords in the Arduino IDE editor. It doesn't actually have any functional purpose, your library will work as well without that file. It's formatted with the keyword separated by the keyword identifier by one or more tabs. It must be a true tab, not spaces, or it won't work. Use the keywords.txt files for other libraries as a reference.

When developing the library, I tried to use in the .cpp file Serial.println() -command in debugging but failed. How I can use it in the library code?
Add the line:
Code: [Select]
#include <Arduino.h>
This is not necessary in sketches because the Arduino IDE automatically adds that line when the sketch is compiled but it doesn't do this for library files.

ELohiiri


Go Up