Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
低功耗
英飞凌Infineon
PSoC™ 62 温湿采集功耗测试
发布于 2023-06-03 09:56:52 浏览:208910
订阅该版
https://club.rt-thread.org/ask/article/a14eed372d5e6aff.html 在这篇文章中我们展示如何采集温湿度计,今天向大家介绍采集温度后显示于墨水屏。并实现深度休眠模式,同时展示工作、休眠的电流检测。 1、增加墨水屏显示: 创建epaper文件夹并加入下图所示的spi驱动、墨水屏显示、绘画、字库等: ![screenshot_image.png](https://oss-club.rt-thread.org/uploads/20230603/8bce93aaddbc42eecf7a5473fd6eb358.png) 2、main.c的实现: ```c #include
#include
#include "sensor_renesas_hs300x.h" #include "drv_gpio.h" #include
#include "Display_EPD_w21.h" #include "Display_EPD_W21_spi.h" #include "fonts.h" #include "GUI_Paint.h" #define LED_PIN GET_PIN(0, 0) #define USE_SECONDS_FOR_ALARM 10 #define LONG_GLITCH_DELAY_MS 100u /* in ms */ #define RTC_INTERRUPT_PRIORITY 3u void set_rtc_alarm_date_time(void); cyhal_rtc_t rtc_obj; unsigned char BlackImage[4736];//Define canvas space extern struct hs300x_device temp_humi_dev; int main(void) { cy_rslt_t result; float temp, humi; uint8_t show_str[20] = {0}; EPD_GPIO_Init(); //EPD GPIO initialization __enable_irq(); rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT); Paint_NewImage(BlackImage, 128, 296, 270, WHITE); //Set screen size and display orientation Paint_SelectImage(BlackImage);//Set the virtual canvas data storage location Paint_NewImage(BlackImage, EPD_WIDTH, EPD_HEIGHT, 270, WHITE); //Set screen size and display orientation Paint_SelectImage(BlackImage);//Set the virtual canvas data storage location EPD_DeepSleep(); /* Initialize RTC */ cyhal_rtc_enable_event(&rtc_obj, CYHAL_RTC_ALARM, RTC_INTERRUPT_PRIORITY, true); set_rtc_alarm_date_time(); for (;;) { /* Go to deep sleep */ cyhal_syspm_deepsleep(); set_rtc_alarm_date_time(); hs300x_read_data(&temp_humi_dev, &humi, &temp); EPD_HW_Init(); //Electronic paper initialization EPD_HW_Init_GUI(); //EPD init GUI Paint_Clear(WHITE); sprintf(show_str,"温度%02d.%02d℃",(int)temp, (int)(temp*100)%100); Paint_DrawString_CN(40,0,show_str, &Font24CN, WHITE, BLACK); sprintf(show_str,"湿度%02d.%02d%%",(int)humi, (int)(humi*100)%100); Paint_DrawString_CN(40,40,show_str, &Font24CN, WHITE, BLACK); EPD_Display(BlackImage); //display image EPD_DeepSleep();//EPD_DeepSleep,Sleep instruction is necessary, please do not delete!!! } } ``` 实现的效果: ![显示.jpg](https://oss-club.rt-thread.org/uploads/20230603/6e47bcba4b45a1bcd0c7735b1798694b.jpg.webp) 上传开发板以后工作电流为19MA,休眠电流为450uA左右。 ![工作.jpg](https://oss-club.rt-thread.org/uploads/20230603/17355e6c5dc2d8c14ca7b043eb588a6f.jpg.webp) ![休眠电流.jpg](https://oss-club.rt-thread.org/uploads/20230603/a8603a0b5ea8e87f71f9a87813ab95b3.jpg.webp) [展示视频](https://www.bilibili.com/video/BV1bP411X7vP/?pop_share=1&vd_source=e1bd226340c8b87027d5dcfc6b0c3344 "展示视频")
1
条评论
默认排序
按发布时间排序
登录
注册新账号
关于作者
Lu_盼盼
这家伙很懒,什么也没写!
文章
27
回答
18
被采纳
0
关注TA
发私信
相关文章
1
RTT Studio STM32f4系列低功耗实现
2
STM32F205 低功耗
3
关于使用cube 做低功耗产品
4
RT适合制作如智能抄表这种低功耗设备吗?长期休眠一天使用NB发送一次数据
5
低功耗框架_pm_change_sleep_mode()一直刷
6
华大芯片如何在rt-thread系统下使用休眠功能
7
RT-Thread nano配合低功耗,有没有指导文件,实现的难度有多大
8
stm32L431进入低功耗会自动唤醒
9
STM32L 停止模式低功耗,断电重启一次功耗更低
10
rt-Thread 设备操作
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
机器人操作系统 (ROS2) 和 RT-Thread 通信
4
五分钟玩转RT-Thread新社区
5
国产MCU移植系列教程汇总,欢迎查看!
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
热门标签
RT-Thread Studio
串口
LWIP
Env
SPI
Bootloader
AT
ART-Pi
Hardfault
CAN总线
FinSH
USB
文件系统
RT-Thread
DMA
SCons
线程
RT-Thread Nano
MQTT
STM32
RTC
FAL
ESP8266
rt-smart
WIZnet_W5500
ota在线升级
flash
cubemx
I2C
UART
packages_软件包
freemodbus
潘多拉开发板_Pandora
PWM
定时器
ADC
BSP
socket
中断
keil_MDK
编译报错
MicroPython
Debug
SDIO总线
GD32
ulog
C++_cpp
rt_mq_消息队列_msg_queue
flashDB
SFUD
本月问答贡献
Juggernaut
9
个答案
3
次被采纳
小小李sunny
9
个答案
2
次被采纳
xiaorui
18
个答案
1
次被采纳
靖哥哥我滴神
4
个答案
1
次被采纳
编程菜鸟
1
个答案
1
次被采纳
本月文章贡献
ThinkCode
2
篇文章
2
次点赞
Z_Y
1
篇文章
4
次点赞
小手凉凉
1
篇文章
2
次点赞
HAHABO
1
篇文章
1
次点赞
南霁云
1
篇文章
1
次点赞
回到
顶部
发布
问题
投诉
建议
回到
底部