【平头哥RVB2601创意应用开发】+ 基于平头哥RVB2601的智慧家居助手
本帖最后由 DDZZ669 于 2022-6-4 21:28 编辑<p style="text-align:justify"> </p>
<p align="center" style="text-align:center"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:16.0pt"><span style="font-family:"微软雅黑",sans-serif">基于平头哥RVB2601的智慧家居助手</span></span></span></span></p>
<p align="center" style="text-align:center"> </p>
<p align="right" style="text-align:right"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><b><span style="font-size:16.0pt"><span style="font-family:"微软雅黑",sans-serif">作者:码农爱学习</span></span></b></span></span></p>
<ul>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><b><span style="font-size:16.0pt"><span style="background:white"><span style="font-family:"微软雅黑",sans-serif"><span style="color:black">一 项目背景</span></span></span></span></b></span></span></li>
</ul>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">当今时代,已进入万物互联的时代,各种嵌入式硬件产品,通过网络连接互联网,实现万物互联。对于我们的家庭生活来说,能够有一款服务于家庭的智能控制设备,实现诸如这些功能:家中的各种生活电器,通过连接网络,可以进行更方便的远程控制;家中的温度、湿度、空气质量等环境指标,通过连网,也可以方便地为我们展示;最近的天气情况,在出门前方便的为我们提醒;家中休息时,营造娱乐的氛围……</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"> </p>
<ul>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:16.0pt"><span style="font-family:"微软雅黑",sans-serif">二 作品简介</span></span></span></span></li>
</ul>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">基于上述的设想,本项目尝试使用平头哥的RVB2601开发板,设计一款智能家居助手,从而使我们更好的享用家中生活。</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">本项目利用RVB2601的WiFi功能,通过连接互联网可以获取近期天气信息,在板载屏幕上显示,提示我们天气变化;利用RTC功能,显示当前的网络时间;外接温、湿度传感器,可以为我们展示室内真实的温湿度;通过WiFi与其它电器的控制器通信,这里使用ESP8266作为被控节点,实现对其它电器的无线开关控制;利用板子自带的喇叭和连网功能,可以播放网络音乐和视频用来进行娱乐;使用OTA功能,还可以不断对功能进行迭代更新,实现软件功能的空中升级。</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">本项目的最终实现是事物照片如下,通过ESP8266板载的一个LED和外接的LED模拟家中的两个不同的灯,外接的小风扇模拟家中的风扇:</span></span></span></span></span></p>
<p align="center" style="text-align:center"> </p>
<p align="center" class="MsoCaption" style="text-align:center"></p>
<p style="text-align:justify"> </p>
<ul>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:16.0pt"><span style="font-family:"微软雅黑",sans-serif">三 系统框图</span></span></span></span></li>
</ul>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">本项目的整体硬件结构如下:主体为RVB2601主控制器,通过路由器于家中其它电器进行无线连接,实现家中电器的开关控制,并可通过连接互联网,实现互联网信息(网络天气、网络时间、网络音乐的获取)。</span></span></span></span></span></p>
<p align="center" style="text-align:center"> </p>
<p align="center" class="MsoCaption" style="text-align:center"></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">为了实现各个功能的选择调用,本项目利用多级菜单的结构,实现各个功能间的跳转,具体的结构如下:</span></span></span></span></span></p>
<p align="center" style="text-align:center"> </p>
<p align="center" class="MsoCaption" style="text-align:center"></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">关于多级菜单的具体实现细节,在下面的“各部分功能说明和解析”中将详细介绍。</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">软件部分,本项目使用平头哥的CDK集成开发环境进行代码编写与调试,使用YoC 软件平台框架以及AOS API实现程序设计:</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">使用任务创建功能,实现各个模块功能的独立设计与维护;</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">使用信号量机制,实现不同任务间的信息同步;</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">使用消息队列,实现不同任务间的消息传递;</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">使用订阅发布机制,实现任务间的解耦;</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">使用RTC功能,实现时间的获取;</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">使用SPI功能,实现屏幕的驱动与显示;</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">使用日志组件,实现代码的调试与信息输出;</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">……</span></span></span></span></span></p>
<ul>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:16.0pt"><span style="font-family:"微软雅黑",sans-serif">四 各部分功能说明和解析</span></span></span></span></li>
</ul>
<p class="MsoSubtitle" style="margin-top:16px; margin-bottom:4px"><span style="font-size:16pt"><span style="line-height:130%"><span style="font-family:微软雅黑,sans-serif"><span style="font-weight:bold"><span lang="EN-US" style="line-height:130%"><span style="font-family:"微软雅黑",sans-serif"><span style="font-weight:normal">4.1</span></span></span><span style="line-height:130%"><span style="font-family:"微软雅黑",sans-serif"><span style="font-weight:normal">城市天气显示</span></span></span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">RVB2601</span></span></span><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">具有连网功能,可以连接互联网来实现对网络天气信息的获取。</span></span></span></span></span></p>
<p style="text-indent:28.8pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">这里使用高德平台的天气获取接口,通过http协议获取指定城市的天气数据。原始数据是json格式的,需要从json数据中解析出天气、温度等信息,然后将这些信息显示到屏幕中。</span></span></span></span></span></p>
<p style="text-indent:28.8pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">这里使用U8g2库来进行天气信息的显示,U8g2库自带了一些天气图标,可以将对应的天气信息转换为对应的天气图标显示出来。</span></span></span></span></span></p>
<p style="text-indent:28.8pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">另外,天气的显示包括主页常驻地的天气显示,可以菜单页中不同城市的天气显示,通过在菜单页中查看对应城市的天气后,主页的常驻地也会跟着变为菜单中查看的那个城市,从而实现主页常住地的切换。</span></span></span></span></span></p>
<p align="center" style="text-align:center"> </p>
<p align="center" class="MsoCaption" style="text-align:center"></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"> <span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">关于U8g2库在RVB2601上的具体移植过程,可参考前期的试用报告:</span></span></span><a href="https://bbs.eeworld.com.cn/thread-1198007-1-1.html" style="color:#0563c1; text-decoration:underline" target="_blank"><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">【平头哥RVB2601</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">创意应用开发】实践2-</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">移植U8g2</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">图形库</span></span></span></a><b> </b></span></span></p>
<p class="MsoSubtitle" style="margin-top:16px; margin-bottom:4px"><span style="font-size:16pt"><span style="line-height:130%"><span style="font-family:微软雅黑,sans-serif"><span style="font-weight:bold"><span lang="EN-US" style="line-height:130%"><span style="font-family:"微软雅黑",sans-serif"><span style="font-weight:normal">4.2</span></span></span><span style="line-height:130%"><span style="font-family:"微软雅黑",sans-serif"><span style="font-weight:normal">当前时间显示</span></span></span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">RVB2601</span></span></span><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">具体RTC(Real_Time Clock)功能,可以实现时间的显示,虽然RVB2601的RTC没有配置电池,掉电后时间就没了,但RVB2601的连网功能,可以在每次开机时,通过获取网络时间,来为RTC重新校准时间。参考<a href="https://yoc.docs.t-head.cn/yocbook/Chapter3-AliOS/CSI%E8%AE%BE%E5%A4%87%E9%A9%B1%E5%8A%A8%E6%8E%A5%E5%8F%A3/CSI1/RTC.html" style="color:#0563c1; text-decoration:underline">YOC文档</a>,可以学习RTC功能的基本用法。</span></span></span></span></span></p>
<p align="center" style="text-align:center"> </p>
<p align="center" class="MsoCaption" style="text-align:center"></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">网络天气与时间的具体实现细节,可参考之前的试用报告:</span></span></span><a href="https://bbs.eeworld.com.cn/thread-1202304-1-1.html" style="color:#0563c1; text-decoration:underline" target="_blank"><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">【平头哥RVB2601</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">创意应用开发】实践7-U8g2</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">库显示网络天气和时间</span></span></span></a></span></span></p>
<p class="MsoSubtitle" style="margin-top:16px; margin-bottom:4px"><span style="font-size:16pt"><span style="line-height:130%"><span style="font-family:微软雅黑,sans-serif"><span style="font-weight:bold"><span lang="EN-US" style="line-height:130%"><span style="font-family:"微软雅黑",sans-serif"><span style="font-weight:normal">4.3</span></span></span><span style="line-height:130%"><span style="font-family:"微软雅黑",sans-serif"><span style="font-weight:normal">室内温湿度显示</span></span></span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">除了显示不同城市的天气数据,家庭环境中的温湿度也值得我们关注,这里就通过RVB2601外接一个温湿度传感器(DHT11)来实现室内温湿度数据的采集与显示。</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">DHT11</span></span></span><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">数字温湿度传感器是一款含有已校准数字信号输出的温湿度复合传感器,微控制器与 DHT11之间的通讯和同步,采用单总线数据格式,这里将DHT11的数据线接至DHT11的PA10引脚上。再过按键切换功能,实现屏幕上主页界面与室内温湿度页面的切换显示。</span></span></span></span></span></p>
<p align="center" style="text-align:center"> </p>
<p align="center" class="MsoCaption" style="text-align:center"></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">DHT11</span></span></span><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">数据读取与显示程序如下:</span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"> </span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">DHT11</span></span></span><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">的更多实现细节,可参考前期的使用报告:</span></span></span><a href="https://bbs.eeworld.com.cn/thread-1198871-1-1.html" style="color:#0563c1; text-decoration:underline" target="_blank"><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">【平头哥RVB2601</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">创意应用开发】实践3-</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">外接DHT11</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">显示温湿度</span></span></span></a></span></span></p>
<p class="MsoSubtitle" style="margin-top:16px; margin-bottom:4px"><span style="font-size:16pt"><span style="line-height:130%"><span style="font-family:微软雅黑,sans-serif"><span style="font-weight:bold"><span lang="EN-US" style="line-height:130%"><span style="font-family:"微软雅黑",sans-serif"><span style="font-weight:normal">4.4</span></span></span><span style="line-height:130%"><span style="font-family:"微软雅黑",sans-serif"><span style="font-weight:normal">多级菜单</span></span></span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">为了实现更多的功能操作,引入了多级菜单的功能,通过板子上两个按键的配合,实现不同功能的选择与触发。</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">这里使用数组查表法的方式,实现了一个三级菜单的功能:</span></span></span></span></span></p>
<ul>
<li align="left" style="margin-left:54px; text-align:left"><span style="font-size:10.5pt"><span style="background:white"><span style="line-height:12.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:"Times New Roman",serif"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">第一级和第二级是功能选项</span></span></span></span></span></span></span></li>
<li align="left" style="margin-left:54px; text-align:left"><span style="font-size:10.5pt"><span style="background:white"><span style="line-height:12.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:"Times New Roman",serif"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">第三级是要实现的具体功能</span></span></span></span></span></span></span></li>
<li align="left" style="margin-left:54px; text-align:left"><span style="font-size:10.5pt"><span style="background:white"><span style="line-height:12.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:"Times New Roman",serif"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">通过左边按键实现上下项目的切换</span></span></span></span></span></span></span></li>
<li align="left" style="margin-left:54px; text-align:left"><span style="font-size:10.5pt"><span style="background:white"><span style="line-height:12.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:"Times New Roman",serif"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">通过右边按键实现各级菜单间的跳转</span></span></span></span></span></span></span></li>
</ul>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">数组查表法是基本原理是通过一个结构体数组,实现各个菜单页面的跳转:</span></span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">结构体中4个成员的含义为:</span></span></span></span></span></p>
<ul>
<li align="left" style="margin-left:54px; text-align:left"><span style="font-size:10.5pt"><span style="background:white"><span style="line-height:12.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">current</span></span><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">:当前页面的索引号</span></span></span></span></span></span></span></li>
<li align="left" style="margin-left:54px; text-align:left"><span style="font-size:10.5pt"><span style="background:white"><span style="line-height:12.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">down</span></span><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">:按下“向下翻“按钮后要跳转到的页面索引号</span></span></span></span></span></span></span></li>
<li align="left" style="margin-left:54px; text-align:left"><span style="font-size:10.5pt"><span style="background:white"><span style="line-height:12.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">enter</span></span><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">:按下“确认“按钮后要跳转到的页面索引号</span></span></span></span></span></span></span></li>
<li align="left" style="margin-left:54px; text-align:left"><span style="font-size:10.5pt"><span style="background:white"><span style="line-height:12.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">current_operation</span></span><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">:当前页面的索引号要执行的显示函数</span></span></span></span></span></span></span></li>
</ul>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">这里的显示函数,加了两个参数:</span></span></span></span></span></p>
<ul>
<li align="left" style="margin-left:54px; text-align:left"><span style="font-size:10.5pt"><span style="background:white"><span style="line-height:12.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:"Times New Roman",serif"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">第一个参数用来表示该界面是否是第一次进入,如果是,则按需做一些初始化处理,比如查询不同程序的天气时,第一次进入某个城市的天气界面,需要先获取一次网络天气;</span></span></span></span></span></span></span></li>
<li align="left" style="margin-left:54px; text-align:left"><span style="font-size:10.5pt"><span style="background:white"><span style="line-height:12.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:"Times New Roman",serif"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">第二个参数用来表示该界面是否需要在本界面内实现某些功能切换,比如家中电器控制的界面中,控制电器开和关时,就要用到这个参数,以用来显示不同开关状态的界面。</span></span></span></span></span></span></span></li>
</ul>
<p align="left" style="text-align:left"> </p>
<p align="left" style="text-align:left; text-indent:28.0pt"><span style="font-size:10.5pt"><span style="background:white"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="color:black"><span style="font-weight:normal">本项目中,多级菜单的前两级的展示示例如下:</span></span></span></span></span></span></span></p>
<p align="center" style="text-align:center"> </p>
<p align="center" class="MsoCaption" style="text-align:center"></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">多级菜单的更多实现细节,可参考前期的使用报告:</span></span></span><a href="https://bbs.eeworld.com.cn/thread-1201780-1-1.html" style="color:#0563c1; text-decoration:underline" target="_blank"><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">【平头哥RVB2601</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">创意应用开发】实践6-</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">多级菜单显示测试</span></span></span></a></span></span></p>
<p class="MsoSubtitle" style="margin-top:16px; margin-bottom:4px"><span style="font-size:16pt"><span style="line-height:130%"><span style="font-family:微软雅黑,sans-serif"><span style="font-weight:bold"><span lang="EN-US" style="line-height:130%"><span style="font-family:"微软雅黑",sans-serif"><span style="font-weight:normal">4.5</span></span></span><span style="line-height:130%"><span style="font-family:"微软雅黑",sans-serif"><span style="font-weight:normal">音乐&视频娱乐</span></span></span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">RVB2601</span></span></span><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">具有连网功能,并且板载了一个喇叭,可以通过网络获取一些音乐或视频资源,实现家居娱乐功能。首先介绍网络音乐播放功能。</span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:宋体">4.5.1 </span></span><span style="font-size:14.0pt"><span style="font-family:宋体">音乐播放功能</span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">音乐播放参考了官方的webplayer例程,在此基础上,实现按键控制不同音乐的播放开始与停止,以及播放时的屏幕显示功能。</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">为了配合其它功能对按键与屏幕的使用,这里创建了一个音乐播放任务,来控制音乐的播放:</span></span></span></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"></p>
<p align="left" style="text-align:left; text-indent:28.0pt"><span style="font-size:10.5pt"><span style="background:white"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="color:black"><span style="font-weight:normal">音乐播放的菜单进入界面与音乐播放界面如下图所示,在音乐播放时,设计了两个位置交错的音乐图标循环显示,实现一种正在播放的画面效果。</span></span></span></span></span></span></span></p>
<p align="center" style="text-align:center"> </p>
<p align="center" class="MsoCaption" style="text-align:center"></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">网络音乐播放的更多实现细节,可参考前期的使用报告:</span></span></span><a href="https://bbs.eeworld.com.cn/thread-1200111-1-1.html" style="color:#0563c1; text-decoration:underline" target="_blank"><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">【平头哥RVB2601</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">创意应用开发】实践4-</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">按键控制网络音乐播放</span></span></span></a></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">下面再来介绍视频播放功能。</span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:宋体">4.5.2 </span></span><span style="font-size:14.0pt"><span style="font-family:宋体">视频播放功能</span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">本项目中视频播放的基本原理是:利用TCP连网功能,使RVB2601作为客户端,笔记本电脑作为服务器端,使RVB2601与ESP8266板子在同一局域网下无线通信,RVB2601获取服务器端的视频帧数据,再借助U8g2图形库,将每一帧的图形显示出来。</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">电脑端通过Python程序,作为TCP服务器,其主要功能为:</span></span></span></span></span></p>
<ul>
<li style="margin-left:54px"><span style="font-size:12pt"><span style="background:white"><span style="line-height:21.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">利用OpenCV读取视频文件</span></span></span></span></span></span></span></span></li>
<li style="margin-left:54px"><span style="font-size:12pt"><span style="background:white"><span style="line-height:21.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">对视频帧的图像,进行尺寸修改</span></span></span></span></span></span></span></span></li>
<li style="margin-left:54px"><span style="font-size:12pt"><span style="background:white"><span style="line-height:21.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">对图像进行二值化处理</span></span></span></span></span></span></span></span></li>
<li style="margin-left:54px"><span style="font-size:12pt"><span style="background:white"><span style="line-height:21.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">将二值图像转换为数组</span></span></span></span></span></span></span></span></li>
<li style="margin-left:54px"><span style="font-size:12pt"><span style="background:white"><span style="line-height:21.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">将数组通过socket发送出去</span></span></span></span></span></span></span></span></li>
</ul>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">电脑端的主体代码如下:</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"></p>
<p style="text-indent:56.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">RVB2601</span></span></span><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">端,通过连接对应的服务器,在接收到图像数据后,显示出来即可:</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"> </p>
<p style="text-indent:56.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">视频播放的截图效果如下,实际播放效果请看演示视频。</span></span></span></span></span></p>
<p align="center" style="text-align:center"> </p>
<p align="center" class="MsoCaption" style="text-align:center"></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><a name="_Hlk105252322"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">视频播放的更多实现细节</span></span></span></a><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">,可参考前期的试用报告:</span></span></span><a href="https://bbs.eeworld.com.cn/thread-1205225-1-1.html" style="color:#0563c1; text-decoration:underline" target="_blank"><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">【平头哥RVB2601</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">创意应用开发】实践9-</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">板载屏幕播放BadApple</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">视频</span></span></span></a><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">,需注意的时,前期这篇试用报告,是在TCP数据接收回调函数中,直接进行图像的显示的,而在此次结项综合例程中,为了配合各个功能对屏幕的使用,在回调函数中收到视频数据后,采用消息队列的方式,将数据再转发出去,由屏幕显示程序来处理何时要在屏幕上显示视频。</span></span></span></span></span></p>
<p class="MsoSubtitle" style="margin-top:16px; margin-bottom:4px"><span style="font-size:16pt"><span style="line-height:130%"><span style="font-family:微软雅黑,sans-serif"><span style="font-weight:bold"><span lang="EN-US" style="line-height:130%"><span style="font-family:"微软雅黑",sans-serif"><span style="font-weight:normal">4.6</span></span></span><span style="line-height:130%"><span style="font-family:"微软雅黑",sans-serif"><span style="font-weight:normal">家居电器控制</span></span></span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">家居电器的控制功能,通过RVB2601与ESP8266无线TCP通信实现,ESP8266作为被控制电器的无线控制器,与主控RVB2601通信。ESP8266作为TCP服务器端,RVB2601作为TCP客户端,通过指定的IP与端口号进行连接。</span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:宋体">4.6.1 </span></span><span style="font-size:14.0pt"><span style="font-family:宋体">灯的开关控制</span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">ESP8266</span></span></span><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">使用Arduino IDE进行开发与程序编写,主程序逻辑为:等待客户端连接,并接收客户端的指令,接收到后,对指令进行解析,执行对应的LED亮灭操作。</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">这里是以字符串的形式进行数据传送,比如“led on”就是开灯,“led off”就是关灯。</span></span></span></span></span></p>
<p align="center" style="text-align:center"> </p>
<p align="center" class="MsoCaption" style="text-align:center"></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:宋体">4.6.2 </span></span><span style="font-size:14.0pt"><span style="font-family:宋体">风扇的开关控制</span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">风扇的控制与灯的控制逻辑一样,只需再定义“fan on"和“fan off”这样的指令用来进行风扇的控制。硬件方面,由于这个小风扇的相比较LED来说,需要的电流较大,这里使用一个继电器来间接控制风扇电源的通断</span></span></span><span style="font-size:14.0pt"><span style="font-family:宋体">。</span></span></span></span></p>
<p align="center" style="text-align:center"> </p>
<p align="center" class="MsoCaption" style="text-align:center"></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">更多实现细节,可参考前期的使用报告:</span></span></span><a href="https://bbs.eeworld.com.cn/thread-1204965-1-1.html" style="color:#0563c1; text-decoration:underline" target="_blank"><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">【平头哥RVB2601</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">创意应用开发】实践8-TCP</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">连接ESP8266</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">节点控制LED</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">亮灭</span></span></span></a></span></span></p>
<p class="MsoSubtitle" style="margin-top:16px; margin-bottom:4px"><span style="font-size:16pt"><span style="line-height:130%"><span style="font-family:微软雅黑,sans-serif"><span style="font-weight:bold"><span lang="EN-US" style="line-height:130%"><span style="font-family:"微软雅黑",sans-serif"><span style="font-weight:normal">4.7RGB</span></span></span><span style="line-height:130%"><span style="font-family:"微软雅黑",sans-serif"><span style="font-weight:normal">呼吸灯</span></span></span></span></span></span></span></p>
<p style="text-indent:14.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">RGB</span></span></span><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">呼吸灯是本项目的一个附件功能,通过一个独立的RGB_LED任务,实现3种颜色的LED呼吸亮灭。它也可以在调试程序中,作为程序是否正常运行的判断标志。</span></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p align="center" style="text-align:center"> </p>
<p align="center" class="MsoCaption" style="text-align:center"></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:16.0pt"><span style="font-family:"微软雅黑",sans-serif">五、作品源码</span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:16.0pt"><span style="font-family:"微软雅黑",sans-serif"><a href="https://gitee.com/xxpcb/rbv2601-test" style="color:#0563c1; text-decoration:underline"><span style="font-weight:normal">https://gitee.com/xxpcb/rbv2601-test</span></a></span></span></span></span></p>
<p align="center" style="text-align:center"> </p>
<p align="center" class="MsoCaption" style="text-align:center"></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><b><span style="font-size:16.0pt"><span style="font-family:"微软雅黑",sans-serif">六、视频<span style="font-family:"微软雅黑",sans-serif">演示</span></span></span></b></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:"微软雅黑",sans-serif">简介</span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">平头哥RVB2601创意应用开发——智慧家居助手,主要展示的功能包括:</span></span></span></span></span></p>
<ul>
<li style="margin-left:54px"><span style="font-size:12pt"><span style="background:white"><span style="line-height:21.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">城市天气显示(主页常驻地天气与菜单页不同城市天气,连网获取网络天气)</span></span></span></span></span></span></span></span></li>
<li style="margin-left:54px"><span style="font-size:12pt"><span style="background:white"><span style="line-height:21.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">当前时间显示(日期、时、分、秒、星期,连网获取网络时间)</span></span></span></span></span></span></span></span></li>
<li style="margin-left:54px"><span style="font-size:12pt"><span style="background:white"><span style="line-height:21.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">室内温湿度显示(DHT11温湿度传感器)</span></span></span></span></span></span></span></span></li>
<li style="margin-left:54px"><span style="font-size:12pt"><span style="background:white"><span style="line-height:21.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">多级菜单(三级菜单实现各功能界面的跳转)</span></span></span></span></span></span></span></span></li>
<li style="margin-left:54px"><span style="font-size:12pt"><span style="background:white"><span style="line-height:21.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">音乐播放功能(网络音乐播放)</span></span></span></span></span></span></span></span></li>
<li style="margin-left:54px"><span style="font-size:12pt"><span style="background:white"><span style="line-height:21.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">视频播放功能(连接电脑端TCP服务器获取视频帧数据)</span></span></span></span></span></span></span></span></li>
<li style="margin-left:54px"><span style="font-size:12pt"><span style="background:white"><span style="line-height:21.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">家居电器控制(灯的控制、风扇的控制)</span></span></span></span></span></span></span></span></li>
<li style="margin-left:54px"><span style="font-size:12pt"><span style="background:white"><span style="line-height:21.0pt"><span style="tab-stops:list 36.0pt"><span style="font-family:宋体"><span lang="EN-US" style="font-size:10.5pt"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">RGB</span></span></span><span style="font-size:10.5pt"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#333333">呼吸灯</span></span></span></span></span></span></span></span></li>
</ul>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:"微软雅黑",sans-serif">视频链接</span></span></span></span></p>
<p style="text-indent:32.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span lang="EN-US" style="font-size:16.0pt"><span style="font-family:"微软雅黑",sans-serif"><span style="font-weight:normal"><a href="https://www.bilibili.com/video/BV1ZY411T7nb" style="color:#0563c1; text-decoration:underline">https://www.bilibili.com/video/BV1ZY411T7nb</a></span></span></span></span></span></p>
<p align="center" style="text-align:center"> </p>
<p style="text-align:justify"></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"> </span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><b><span style="font-size:16.0pt"><span style="font-family:"微软雅黑",sans-serif">七、项目总结</span></span></b></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">本项目基于平头哥的RVB2601,设计了一款智慧家居助手,实现了网络天气、时间的获取与显示、室内温湿度的获取与显示、家中电器的无线控制,音乐与视频娱乐功能等,帮助我们更好的体验家中环境。</span></span></span></span></span></p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><span style="font-size:14.0pt"><span style="font-family:宋体"><span style="font-weight:normal">从3个月前拿到板子,逐步熟悉CDK环境的开发与RISC-V的开发体验,在使用过程中,不断分享使用笔记,并学习其它网友积极分享的笔记,最后将所有使用过的功能,整合为一个综合的小项目,就实现了这个智慧家居助手。</span></span></span></span></span></p>
<p style="text-indent:28.1pt; text-align:justify"> </p>
<p style="text-indent:28.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><b><span style="font-size:14.0pt"><span style="font-family:"微软雅黑",sans-serif">附:RVB2601试用分享汇总(9篇)</span></span></b></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><a href="https://bbs.eeworld.com.cn/thread-1197117-1-1.html" style="color:#0563c1; text-decoration:underline" target="_blank"><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">【RVB2601</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">】实践1-</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">开箱测评与软件环境搭建</span></span></span></a></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><a href="https://bbs.eeworld.com.cn/thread-1198007-1-1.html" style="color:#0563c1; text-decoration:underline" target="_blank"><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">【平头哥RVB2601</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">创意应用开发】实践2-</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">移植U8g2</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">图形</span></span></span></a></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><a href="https://bbs.eeworld.com.cn/thread-1198871-1-1.html" style="color:#0563c1; text-decoration:underline" target="_blank"><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">【平头哥RVB2601</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">创意应用开发】实践3-</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">外接DHT11</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">显示温湿度</span></span></span></a></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><a href="https://bbs.eeworld.com.cn/thread-1200111-1-1.html" style="color:#0563c1; text-decoration:underline" target="_blank"><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">【平头哥RVB2601</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">创意应用开发】实践4-</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">按键控制网络音乐播放</span></span></span></a></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><a href="https://bbs.eeworld.com.cn/thread-1200957-1-1.html" style="color:#0563c1; text-decoration:underline" target="_blank"><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">【平头哥RVB2601</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">创意应用开发】实践5-FOTA</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">升级显示下载进度</span></span></span></a></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><a href="https://bbs.eeworld.com.cn/thread-1201780-1-1.html" style="color:#0563c1; text-decoration:underline" target="_blank"><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">【平头哥RVB2601</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">创意应用开发】实践6-</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">多级菜单显示测试</span></span></span></a></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><a href="https://bbs.eeworld.com.cn/thread-1202304-1-1.html" style="color:#0563c1; text-decoration:underline" target="_blank"><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">【平头哥RVB2601</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">创意应用开发】实践7-U8g2</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">库显示网络天气和时间</span></span></span></a></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><a href="https://bbs.eeworld.com.cn/thread-1204965-1-1.html" style="color:#0563c1; text-decoration:underline" target="_blank"><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">【平头哥RVB2601</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">创意应用开发】实践8-TCP</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">连接ESP8266</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">节点控制LED</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">亮灭</span></span></span></a></span></span></p>
<p style="text-indent:21.0pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><a href="https://bbs.eeworld.com.cn/thread-1205225-1-1.html" style="color:#0563c1; text-decoration:underline" target="_blank"><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">【平头哥RVB2601</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">创意应用开发】实践9-</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">板载屏幕播放BadApple</span></span></span><span lang="EN-US" style="border:none windowtext 1.0pt; background:white; padding:0cm"><span style="font-family:"微软雅黑",sans-serif"><span style="color:#e60012">视频</span></span></span></a></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:"Times New Roman",serif"><b><span style="font-size:16.0pt"><span style="font-family:"微软雅黑",sans-serif">八、其他</span></span></b></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify">word文档太大,这里上传PDF版的作品说明文档:</p>
<p style="text-align:justify"></p>
<p style="text-align:justify"> </p>
<p>楼主的平头哥RVB2601玩的很溜</p>
<p>感谢楼主的分享...............</p>
<p>很用心</p>
<p>源码资料:<a href="https://download.eeworld.com.cn/detail/DDZZ669/623791" target="_blank">https://download.eeworld.com.cn/detail/DDZZ669/623791</a></p>
页:
[1]