Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
潘多拉开发板_Pandora
基于潘多拉开发使用rt-thread studio 开发使用软件包AHT10遇到....
发布于 2020-05-26 18:00:10 浏览:2762
订阅该版
基于潘多拉开发板使用的问题: 配置了I2c总线和软件包,初始化也成功了,但是无法读取数据时怎么回事?有哪位大神帮忙看看? ```c #include
#include
#include
#define DBG_TAG "main" #define DBG_LVL DBG_LOG #include
/* PLEASE DEFINE the LED0 pin for your board, such as: PA5 */ #define LED0_PIN GET_PIN(E, 7) #include "aht10.h" #include "sensor_asair_aht10.h" #define AHT10_I2C_BUS "i2c1" int rt_hw_aht10_port(void) { struct rt_sensor_config cfg; cfg.intf.dev_name = AHT10_I2C_BUS; cfg.intf.user_data = (void *)AHT10_I2C_ADDR; rt_hw_aht10_init("aht10", &cfg); LOG_D("aht10 is OK!"); return RT_EOK; } int main(void) { rt_err_t res; float humidity, temperature; int count = 1; aht10_device_t dev; rt_hw_aht10_port(); dev = aht10_init(AHT10_I2C_BUS); if (dev == RT_NULL) { LOG_E(" The sensor initializes failure"); return 0; } else { LOG_D(" The sensor initializes ok!"); } /* set LED0 pin mode to output */ rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT); while (count++) { humidity = aht10_read_humidity(dev); rt_kprintf("humidity : %d.%d %%
", (int)humidity, (int)(humidity * 10) % 10); /* former is integer and behind is decimal */ /* read temperature */ temperature = aht10_read_temperature(dev); rt_kprintf("temperature: %d.%d
", (int)temperature, (int)(temperature * 10) % 10); /* former is integer and behind is decimal */ rt_thread_mdelay(1000); /* set LED0 pin level to high or low */ rt_pin_write(LED0_PIN, count % 2); // LOG_D("Hello RT-Thread!"); rt_thread_mdelay(1000); } return RT_EOK; } ```
查看更多
5
个回答
默认排序
按发布时间排序
cgh198510
2020-05-26
这家伙很懒,什么也没写!
[E/AHT10] The aht10 is under an abnormal status. Please try again humidity : 0.0 % temperature: -50.0 [E/AHT10] The aht10 is under an abnormal status. Please try again [E/AHT10] The aht10 is under an abnormal status. Please try again humidity : 0.0 % temperature: -50.0 [E/AHT10] The aht10 is under an abnormal status. Please try again [E/AHT10] The aht10 is under an abnormal status. Please try again humidity : 0.0 % temperature: -50.0 [E/AHT10] The aht10 is under an abnormal status. Please try again [E/AHT10] The aht10 is under an abnormal status. Please try again humidity : 0.0 % temperature: -50.0 [E/AHT10] The aht10 is under an abnormal status. Please try again [E/AHT10] The aht10 is under an abnormal status. Please try again humidity : 0.0 % temperature: -50.0 [E/AHT10] The aht10 is
cgh198510
2020-06-08
这家伙很懒,什么也没写!
>看下用这个例子能读取数据吗https://www.rt-thread.org/document/site/programming-manual/device/i2c/i2c/ ... --- 感谢恢复,是管脚接错了。
姜还是我辣
2020-06-10
这家伙很懒,什么也没写!
楼主你好,我也遇到了相同的问题,同样的报错,请问你是怎么解决的?
姜还是我辣
2020-06-10
这家伙很懒,什么也没写!
软件包中的内容: 注意事项 测试中发现传感器 aht10 为不标准 I2C 设备,总线上出现数据与该器件地址相同,即使没有开始信号,也会响应,导 SDA 死锁。所以,建议用户给 AHT10 独立一个 I2C 总线。 我在想是不是与这个有关系,,
撰写答案
登录
注册新账号
关注者
0
被浏览
2.8k
关于作者
cgh198510
这家伙很懒,什么也没写!
提问
3
回答
6
被采纳
0
关注TA
发私信
相关问题
1
潘多拉开发板AP6181 外设支持报错
2
潘多拉wifi管理例程中ap模式未启动
3
潘多拉开发板上I2C设备驱动开发
4
潘多拉开发板 综合例程 调试报错
5
潘多拉开发板在VSCODE无法执行micropython
6
潘多拉添加freemodbus例子出现错误
7
潘多拉开发板OV2640拍摄JPEG格式的照片
8
SFUD 提示闪存超过32g
9
有谁用潘多拉开发过OV2640吗
10
请问潘多拉开发板怎么烧录micropython固件
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
在LPC1114上移植 RT-Thread Nano 3.1.5
2
求助can通讯下怎末运用485
3
STM32F407ZGT适配串口V2驱动
4
【CFP】2025 RT-Thread全球技术大会演讲征集开始啦!
5
在 RT-Thread Studio 环境中为 ART-Pi 2 移植 CherryUSB(以 usb_device 为例)
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
DMA
USB
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
rt-smart
FAL
I2C_IIC
cubemx
ESP8266
WIZnet_W5500
UART
ota在线升级
BSP
PWM
flash
packages_软件包
freemodbus
潘多拉开发板_Pandora
ADC
GD32
定时器
flashDB
编译报错
keil_MDK
socket
中断
rt_mq_消息队列_msg_queue
Debug
ulog
SFUD
msh
C++_cpp
at_device
本月问答贡献
聚散无由
9
个答案
6
次被采纳
RTT_逍遥
8
个答案
2
次被采纳
a1012112796
5
个答案
2
次被采纳
三世执戟
4
个答案
2
次被采纳
加缪
2
个答案
2
次被采纳
本月文章贡献
wake_mirco
2
篇文章
7
次点赞
mushroom
1
篇文章
9
次点赞
张世争
1
篇文章
7
次点赞
RTT_逍遥
1
篇文章
6
次点赞
Jack_____
1
篇文章
5
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部