首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Adafruit Flora接线板和SI1445

Adafruit Flora接线板和SI1445
EN

Stack Overflow用户
提问于 2021-04-24 06:19:31
回答 1查看 40关注 0票数 1

我正在尝试使用库中给出的测试代码来设置我的新的flora转接板(这里是用于澄清的链接:https://www.adafruit.com/product/659);但是,当我上传代码时,我得到一条错误消息,说找不到转接板。在网上查找了一些资料后,我试着在Arduino ide上的董事会管理器中寻找,但我找不到任何我需要的adafruit flora板。如果任何人知道如何安装adafruit植物电路板或知道一个网站来解释,我将不胜感激。这是我找到的用于安装板的链接:https://learn.adafruit.com/add-boards-arduino-v164/installing-boards

代码语言:javascript
复制
/*************************************************** 
  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);
}

错误消息:

代码语言:javascript
复制
avrdude: ser_open(): can't open device
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-04-25 00:47:02

使用此网站https://learn.adafruit.com/adafruit-arduino-ide-setup/arduino-1-dot-6-x-ide找到了解决方案

需要转到偏好设置并添加adafruit flora和其他主板的GitHub URL

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67237449

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档