arduino打开库文件 |
您所在的位置:网站首页 › arduino下载的库在哪 › arduino打开库文件 |
安装Arduino附加库
当你用着Arduino或者内建函数比较舒服的时候,你可能希望扩展你的Arduino 附加库。 附加库是什么?附加库是一个代码的集合,可以让你方便的连接一台传感器、显示器、模组等等。比如,内建库LiquidCrystal 库使得在LCD上显示字符变得方便。在网络上,有成百上千的附加库可供下载。内建库和一些附加库在链接https://www.arduino.cc/reference/en/libraries/中,这些附加库只有安装后才能使用它们。 库安装方法 1)使用库管理器可以采用库管理器的方式为Arduino IDE安装一个新库(Arduino IDE v1.6.2以后的版本支持)。打开IDE,点击"Sketch"(项目)> Include Library(加载库) > Manage Libraries(管理库),如下图所示。
库一般表现为ZIP文件或文件夹。文件夹的名称一般为库名,文件夹内部一般包括一个.cpp文件和一个.h文件,通常还会有一个关键字.txt文件、示例文件夹,以及该库的其他依赖文件。从Arduino IDE 1.0.5开始,可以安装第三方库。不要解压zip文件,保持它的原始状态。 在Arduino IDE中, Sketch(项目) > Include Library(加载库) > Add .ZIP Library(添加.ZIP库)。 准确的选择要添加的库。导航到.zip文件的位置并打开它。
注意:该库可以用于项目中,但是在旧版本IDE示例中,该库直到IDE重启之前,不会出现在File (文件)> Examples(示例)中 3)手动安装When you want to add a library manually, you need to download it as a ZIP file, expand it and put in the proper directory. The ZIP file contains all you need, including usage examples if the author has provided them. The library manager is designed to install this ZIP file automatically as explained in the former chapter, but there are cases where you may want to perform the installation process manually and put the library in the libraries folder of your sketchbook by yourself. You can find or change the location of your sketchbook folder at File > Preferences > Sketchbook location. Go to the directory where you have downloaded the ZIP file of the library Extract the ZIP file with all its folder structure in a temporary folder, then select the main folder, that should have the library name Copy it in the “libraries” folder inside your sketchbook. Start the Arduino Software (IDE), go to Sketch > Include Library. Verify that the library you just added is available in the list. Please note: Arduino libraries are managed in three different places: inside the IDE installation folder, inside the core folder and in the libraries folder inside your sketchbook. The way libraries are chosen during compilation is designed to allow the update of libraries present in the distribution. This means that placing a library in the “libraries” folder in your sketchbook overrides the other libraries versions. The same happens for the libraries present in additional cores installations. It is also important to note that the version of the library you put in your sketchbook may be lower than the one in the distribution or core folders, nevertheless it will be the one used during compilation. When you select a specific core for your board, the libraries present in the core’s folder are used instead of the same libraries present in the IDE distribution folder. Last, but not least important is the way the Arduino Software (IDE) upgrades itself: all the files in Programs/Arduino (or the folder where you installed the IDE) are deleted and a new folder is created with fresh content. This is why we recommend that you only install libraries to the sketchbook folder so they are not deleted during the Arduino IDE update process. cited:https://www.arduino.cc/en/Guide/Libraries |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |