我想找...

搜尋

分享

目錄

#include

[Further Syntax]

描述

#include is used to include outside libraries in your sketch. This gives the programmer access to a large group of standard C libraries (groups of pre-made functions), and also libraries written especially for 86Duino.

The main reference page for DJGPP C libraries (DJGPP is the compiler that the 86Duino uses) is 這裡.

Note that #include, similar to #define, has no semicolon terminator, and the compiler will yield cryptic error messages if you add one.

語法

#include <LibraryFile.h>
#include "LocalFile.h"

參數

LibraryFile.h: when the angle brackets syntax is used, the libraries paths will be searched for the file.
LocalFile.h: When the double quotes syntax is used, the folder of the file using the #include directive will be searched for the specified file, then the libraries paths if it was not found in the local path. Use this syntax for header files in the sketch’s folder.

範例程式碼

This example includes a library to read the internal BIOS tick counter, which is the number of 18.2 Hz ticks since midnight.

#include <bios.h>
 
long ticks = biostime(0, 0);

語法參考主頁面

86Duino 參考的文本是根據 Creative Commons Attribution-ShareAlike 3.0 License,部分文本是從 the Arduino reference 修改的。 參考中的代碼示例已發佈到公共領域。

發表評論

上部へスクロール