简体   繁体   中英

Creating libraries for Arduino

I want to write a library for my Arduino(header and class files), but I don't know what tools to use for this job and how to test and debug them.

The Arduino IDE just helps in writing plain programs for direct bootloading, not full project management thing (correct me if I am wrong and guide appropriately with relevant references).

Please help.

The compiler supports the #include directive, you can write your library, then #include it. This is expanded on in this tutorial about writing libraries for the Arduino .

For testing you can use ArduinoUnit . This itself is a library - so take a look at the source code (in the download) if you need inspiration.

Just take any Arduino library and look inside. You'll find all what it needs to make one – the class, public and private variables and methods, maybe getters, setters...

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM