Ai
1 Star 1 Fork 0

DFRobot/DFRobot_LWLP

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
readData.ino 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
fengli 提交于 2022-02-18 10:30 +08:00 . 移到dfrobot
/*!
* @file readData.ino
* @brief read the pressure difference
* @details Read pressure difference and temperature value of the differential pressure sensor
* @copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
* @licence The MIT License (MIT)
* @author [fengli](li.feng@dfrobot.com)
* @version V1.0
* @date 2020-05-14
* @url https://github.com/DFRobot/DFRobot_LWLP
*/
#include <DFRobot_LWLP.h>
/*!
* @brief Construct the function
* @param pWire IC bus pointer object and construction device, can both pass or not pass parameters, Wire in default.
* @param address Chip IIC address, addresses 0x0
*/
DFRobot_LWLP lwlp;
void setup() {
Serial.begin(9600);
//Init Chip
while (lwlp.begin() != 0) {
Serial.println("Failed to initialize the chip, please confirm the chip connection");
delay(1000);
}
}
void loop(void){
DFRobot_LWLP::sLwlp_t data;
//Get data of single measurement
data = lwlp.getData();
//Get data processed by the filter
//data = lwlp.getfilterData();
//Get temperature in unit centigrade degree
Serial.print("Temperature: ");
Serial.print(data.temperature);
Serial.println(" C");
Serial.print("Differential Pressure: ");
//Get pressure difference in unit pa
Serial.print(data.presure);
Serial.println(" pa");
delay(500);
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/dfrobot/DFRobot_LWLP.git
git@gitee.com:dfrobot/DFRobot_LWLP.git
dfrobot
DFRobot_LWLP
DFRobot_LWLP
master

搜索帮助