[ESP32-Audio-Kit音频开发板测评] 先让板子动起来
本帖最后由 jinglixixi 于 2021-9-25 10:25 编辑<p><span style="font-size:12pt"><span style="background:white"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">最近测评遇到了两块难啃的骨头,并不是说板子有多难用,而是遇挫在开发环境的构建上,这本不应是什么技术活,只要使用手册做的到位是比较好完成,但恰恰是这一环是开头工作就无法进行下去了!</span></span></span></span></span></span></span></p>
<p><span style="font-size:12pt"><span style="background:white"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">好经过一番探索其中的一块被搞定,且下载非常方便几乎是一键完成,这款板子就是K32W061,它在命令操作窗口使用“↑”就可重现出以前使用的指令,一个回车即可加以执行。然而前期的环境构建会化一些功夫。</span></span></span></span></span></span></span></p>
<p><span style="font-size:12pt"><span style="background:white"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">再有一块就属ESP32-Audio-Kit音频开发板,开发环境的构建同样交代的不很清楚。所幸的是一位坛友介绍了用ArduinoIDE来开发的方式,还是比较实用的,起码先要让板子动起来才是硬道理!</span></span></span></span></span></span></span></p>
<p><span style="font-size:12pt"><span style="background:white"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">当然有喜也有忧,喜的是它可以让板子动起来,有的是它能否提供对语音录放的支持就是未知数了,只好先走一步是一步了。</span></span></span></span></span></span></span></p>
<p><span style="font-size:12pt"><span style="background:white"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">由于前段时间用过ArduinoIDE,所以软件都无需安装了,所需的只是安装一下与开发板相匹配的插件。</span></span></span></span></span></span></span></p>
<p><span style="font-size:12pt"><span style="background:white"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">当前所用的ArduinoIDE版本是1.8.5,需要在打开该软件后,选取“文件”菜单下的“首选项”,然后在网址一栏输入“https://dl.espressif.com/dl/package_esp32_index.json”,并点击按键“好”,参见图1所示。</span></span></span></span></span></span></span></p>
<p><span style="font-size:12pt"><span style="background:white"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">图1 输入网址</span></span></span></span></span></span></span></p>
<p><span style="font-size:12pt"><span style="background:white"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">随后在弹出的“开发板管理器”对话框,选取“esp32 by Espressif Systems”并点击“安装”,见图2所示。</span></span></span></span></span></span></span></p>
<p><span style="font-size:12pt"><span style="background:white"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">图2选取插件</span></span></span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:12pt"><span style="background:white"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">图3安装过程中</span></span></span></span></span></span></span></p>
<p><span style="font-size:12pt"><span style="background:white"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">在完成安装后,点击“关闭”即可。</span></span></span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:12pt"><span style="background:white"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">图4完成安装</span></span></span></span></span></span></span></p>
<p><span style="font-size:12pt"><span style="background:white"><span style="font-family:宋体"><span style="font-size:10.5pt"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">在安装了插件后,在“工具”菜单中使用“开发板管理”,将开发板类型设置为“ESP32 Dev Module”即可,见图5所示。</span></span></span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">图5 选取开发板类型</span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">至此,我们就完成了开发环境的搭建。</span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">在开发板上有2个供用户编程控制的LED,其电路原理图见图6所示。</span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">图6 LED电路</span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">为此,可以用下面的程序来控制LED灯交错点亮。</span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span lang="EN-US" style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">LED</span></span></span><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">控制程序:</span></span></span></span></span></p>
<pre>
<code class="language-cpp">void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(22, OUTPUT);
pinMode(19, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(22, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(19, LOW);
delay(1000); // wait for a second
digitalWrite(22, LOW); // turn the LED off by making the voltage LOW
digitalWrite(19, HIGH);
delay(1000); // wait for a second
}</code></pre>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-family:宋体">经编译和上传,其结果如图</span>7<span style="font-family:宋体">和图</span>8<span style="font-family:宋体">所示。</span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">图7 完成上传</span></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri,sans-serif"><span style="font-family:"微软雅黑","sans-serif""><span style="color:#444444"><span style="letter-spacing:.75pt">图8运行效果</span></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><font color="#444444" face="微软雅黑, sans-serif"><span style="letter-spacing: 1px;">演示动画:</span></font></p>
<p style="text-align:justify"></p>
<p style="text-align:justify"> </p>
<p>不错哦,回头我也试试看</p>
se7ens 发表于 2021-9-23 10:05
不错哦,回头我也试试看
<p>基本的处理用Arduino IDE还是比较容易实现的</p>
页:
[1]