# Arduino Specific README
This guide contains some hints on getting the generic reference drivers working
on Arduino platforms. Note that this is a generic driver meant to be adaptable
to any platform with minimal effort but it is not, by design, a ready-to-use
Arduino driver.
Kindly keep in mind that Sensirion cannot assist with general Arduino questions
not related to the driver.
## Project Setup
Arduino compiles all files in a Library (See
[Build-Process](https://github.com/arduino/Arduino/wiki/Build-Process)). Thus,
for Arduino to pick up the driver as a library all files must be in a directory
with the name of that library and it must be in the folder where your Arduino
IDE installs libraries.
For the sake of this tutorial we'll call this the `sxx30` folder, where _sxx_ is
substituted for the actual project name (name of your _.ino_ file). We suggest
using the driver's name as project name e.g. _sgp30_, _sps30_, _shtc1_ etc.
### Files to copy to your Library folder
Use as base the *release* version of your driver from `make release` or, if
you're not sure what this means, download the release Zip from the driver's
releases page on GitHub, e.g. for the embedded-sgp driver download
_sgp30-x.y.z.zip_ from
[https://github.com/Sensirion/embedded-sgp/releases](https://github.com/Sensirion/embedded-sgp/releases)
* Copy all content except the example usage file (`example_usage.c` or
`sxx30_example_usage.c`) from the release folder into the `sxx30` library
folder.
* Copy the Arduino sample implementation
`sensirion_hw_i2c_implementation.cpp` from this folder into the `sxx30`
library folder.
### A Typical Example Project
```cpp
#include <Arduino.h>
#include "sxx30.h" /* Adapt for your sensor */
void setup() {
/*
// Initialize Serial for debugging
Serial.begin(115200);
while (!Serial) {
delay(100);
}
*/
}
void loop() {
// adapt the code from the main() method content from sxx30_example_usage.c
// make sure to replace any sleep(x) calls with delay(x * 1000)
}
```
### sensirion\_arch\_config.h
Copy the `sensirion_arch_config.h` from this folder to your `sxx30` folder.
Note that it may need additional tweaks according to your specific arduino
platform. If needed, you should ask for help on an Arduino forum for your
specific platform as Sensirion is not in a position to help you with such
questions.
### Board-Specific Setup
Let us know if your Arduino needs a tweak and we'll be happy to document your
changes here.
## Common Compile Errors
This section lists some of the most common compile errors encountered along with
possible solutions. If your error does not appear in this list, your error is
likely not related to the driver and you should ask for help on an Arduino forum
for your specific platform as Sensirion is not in a position to help you with
such questions.
### Sleep was not declared in this scope
Delete the example usage file or replace `sleep(x)` with `delay(x * 1000)`
Multiply by 1000 because delay uses milliseconds but sleep uses seconds.
error: 'sleep' was not declared in this scope
## Hardware
### Limited Receive Buffer
Arduino's Wire library has a limited receive buffer of 30bytes, which is not
enough for the SPS30. We're offering an alternative I2C implementation for
our drivers to address this, called arduino-alt-i2c.
Another possible workaround is using a software-i2c
implementation. See [embedded-sps #7](https://github.com/Sensirion/embedded-sps/issues/7)
for more details.
没有合适的资源?快使用搜索试试~ 我知道了~
Embedded-SGP30-7.1.2,Sensirion官方驱动程序,2021年5月版本
共37个文件
c:16个
cpp:7个
h:7个
需积分: 5 1 下载量 31 浏览量
2022-03-02
10:03:06
上传
评论
收藏 73KB ZIP 举报
温馨提示
Sensirion官方驱动程序,2021年5月版本
资源详情
资源评论
资源推荐
收起资源包目录
Embedded-SGP30-7.1.2.zip (37个子文件)
sgp30-7.1.2
sensirion_i2c.h 4KB
hw_i2c
sample-implementations
Nordic_nRF5_series
sensirion_hw_i2c_implementation.c 5KB
mbed
sensirion_hw_i2c_implementation.cpp 4KB
sgp30_example_usage.cpp 3KB
arduino-alt-i2c
i2c_master_lib.h 4KB
LICENSE_i2c_master_lib 1KB
sensirion_hw_i2c_implementation.cpp 3KB
i2c_master_lib.cpp 20KB
arduino
sensirion_hw_i2c_implementation.cpp 3KB
README.md 3KB
linux_user_space
sensirion_hw_i2c_implementation.c 4KB
STM32F1_series
sensirion_hw_i2c_implementation.c 5KB
Atmel_SAMD2_series
sensirion_hw_i2c_implementation.c 3KB
arduino-mkrzero-multiple-i2c-buses
sensirion_hw_i2c_implementation.cpp 4KB
zephyr_user_space
sensirion_hw_i2c_implementation.c 4KB
sensirion_hw_i2c_implementation.c 4KB
default_config.inc 1KB
sgp30.h 11KB
sw_i2c
sensirion_sw_i2c_gpio.h 2KB
sensirion_sw_i2c.c 5KB
sensirion_sw_i2c_implementation.c 4KB
sample-implementations
Nordic_nRF5_series
sensirion_sw_i2c_implementation.c 5KB
mbed
sensirion_sw_i2c_implementation.cpp 4KB
linux_user_space
sensirion_sw_i2c_implementation.c 7KB
STM32F1_series
sensirion_sw_i2c_implementation.c 5KB
Atmel_SAMD2_series
sensirion_sw_i2c_implementation.c 4KB
user_config.inc 1KB
sgp30.c 12KB
LICENSE 1KB
sensirion_common.c 7KB
sgp_git_version.h 2KB
sensirion_common.h 8KB
CHANGELOG.md 7KB
sgp30_example_usage.c 5KB
Makefile 311B
sgp_git_version.c 106B
sensirion_arch_config.h 3KB
共 37 条
- 1
Mr.老铁
- 粉丝: 7
- 资源: 103
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0