arduino - Adafruit Flora 分线板和 SI1445
问题描述
我正在尝试使用图书馆提供的测试代码设置我的新植物群突破板(这里是澄清链接:https ://www.adafruit.com/product/659);但是,当我上传代码时,我收到一条错误消息,提示找不到该板。在网上查找了一些东西后,我尝试在 Arduino ide 上查看板管理器,但我找不到任何我需要的 adafruit 植物板。如果有人知道如何安装 adafruit 植物区系或知道一个网站来解释,我将不胜感激。这是我找到的安装板的链接:https ://learn.adafruit.com/add-boards-arduino-v164/installing-boards
/***************************************************
This is a library for the Si1145 UV/IR/Visible Light Sensor
Designed specifically to work with the Si1145 sensor in the
adafruit shop
----> https://www.adafruit.com/products/1777
These sensors use I2C to communicate, 2 pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#include <Wire.h>
#include "Adafruit_SI1145.h"
Adafruit_SI1145 uv = Adafruit_SI1145();
void setup() {
Serial.begin(9600);
Serial.println("Adafruit SI1145 test");
if (! uv.begin()) {
Serial.println("Didn't find Si1145");
while (1);
}
Serial.println("OK!");
}
void loop() {
Serial.println("===================");
Serial.print("Vis: "); Serial.println(uv.readVisible());
Serial.print("IR: "); Serial.println(uv.readIR());
// Uncomment if you have an IR LED attached to LED pin!
//Serial.print("Prox: "); Serial.println(uv.readProx());
float UVindex = uv.readUV();
// the index is multiplied by 100 so to get the
// integer index, divide by 100!
UVindex /= 100.0;
Serial.print("UV: "); Serial.println(UVindex);
delay(1000);
}
错误信息:
avrdude: ser_open(): can't open device
解决方案
使用此网站https://learn.adafruit.com/adafruit-arduino-ide-setup/arduino-1-dot-6-x-ide找到了解决方案
需要转到首选项并添加 adafruit 植物群和其他板的 GitHub URL
推荐阅读
- php - 如何使用 PHP Referrer-Policy 将 Firefox 推荐人设置为“无推荐人”?
- arrays - Bash 通过循环使用数组对文件内容进行操作和排序
- javascript - 在 tr 中附加 td,然后在 tbody 中
- php - XML to PHP array issue - Columns being combined into a single Row instead multiple rows
- firebase - 如何在 firebase 托管的 webapp 中获取 firebase 函数 URL?
- kubernetes - CoreDNS 后缀重写导致 DNS 查询返回重写的名称
- docker - 在损坏的系统上备份 docker 卷。卷恢复
- typescript - Ionic 4 路由器没有 navigate 和 navigateByUrl
- elixir - 为什么构造href链接时字符串插值不起作用?
- java - 具有可比接口的通用列表