-
Notifications
You must be signed in to change notification settings - Fork 0
/
730626e3a078.html
376 lines (267 loc) · 25.7 KB
/
730626e3a078.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
<link rel="apple-touch-icon" sizes="180x180" href="/images/mylogo-128x128.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/mylogo-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/mylogo-16x16.png">
<link rel="mask-icon" href="/images/mylogo.svg" color="#222">
<link rel="stylesheet" href="/css/main.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/[email protected]/css/all.min.css" integrity="sha256-mUZM63G8m73Mcidfrv5E+Y61y7a12O5mW4ezU3bxqW4=" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
<script class="next-config" data-name="main" type="application/json">{"hostname":"renshengjihe.cn","root":"/","images":"/images","scheme":"Gemini","darkmode":false,"version":"8.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":"ture","bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":true,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果:${query}","hits_time":"找到 ${hits} 个搜索结果(用时 ${time} 毫秒)","hits":"找到 ${hits} 个搜索结果"}}</script><script src="/js/config.js"></script>
<meta name="description" content="通过一个三极管配合树莓派的 gpio 接口就实现对树莓派散热风扇的控制,使风扇可以根据 cpu 的温度停止或转动">
<meta property="og:type" content="article">
<meta property="og:title" content="树莓派折腾日记-自动控制风扇">
<meta property="og:url" content="https://renshengjihe.cn/730626e3a078">
<meta property="og:site_name" content="人生几何">
<meta property="og:description" content="通过一个三极管配合树莓派的 gpio 接口就实现对树莓派散热风扇的控制,使风扇可以根据 cpu 的温度停止或转动">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://renshengjihe-1257851699.cos.ap-guangzhou.myqcloud.com/190713-PiTempCtrl/%E8%BF%9E%E7%BA%BF%E5%9B%BE.png">
<meta property="og:image" content="https://renshengjihe-1257851699.cos.ap-guangzhou.myqcloud.com/190713-PiTempCtrl/%E5%BC%95%E8%84%9A%E5%9B%BE.png">
<meta property="og:image" content="https://renshengjihe-1257851699.cos.ap-guangzhou.myqcloud.com/190713-PiTempCtrl/%E6%95%88%E6%9E%9C%E5%9B%BE1.png">
<meta property="og:image" content="https://renshengjihe-1257851699.cos.ap-guangzhou.myqcloud.com/190713-PiTempCtrl/%E6%95%88%E6%9E%9C%E5%9B%BE2.png">
<meta property="og:image" content="https://renshengjihe-1257851699.cos.ap-guangzhou.myqcloud.com/190713-PiTempCtrl/%E5%AE%9E%E7%89%A9%E5%9B%BE.jpg">
<meta property="article:published_time" content="2019-07-13T09:08:00.000Z">
<meta property="article:modified_time" content="2021-10-22T16:44:27.979Z">
<meta property="article:author" content="dhd">
<meta property="article:tag" content="树莓派">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://renshengjihe-1257851699.cos.ap-guangzhou.myqcloud.com/190713-PiTempCtrl/%E8%BF%9E%E7%BA%BF%E5%9B%BE.png">
<link rel="canonical" href="https://renshengjihe.cn/730626e3a078.html">
<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://renshengjihe.cn/730626e3a078","path":"730626e3a078.html","title":"树莓派折腾日记-自动控制风扇"}</script>
<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>树莓派折腾日记-自动控制风扇 | 人生几何</title>
<noscript>
<link rel="stylesheet" href="/css/noscript.css">
</noscript>
<!-- hexo injector head_end start -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/katex.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/style.css">
<!-- hexo injector head_end end --></head>
<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
<div class="headband"></div>
<main class="main">
<header class="header" itemscope itemtype="http://schema.org/WPHeader">
<div class="header-inner"><div class="site-brand-container">
<div class="site-nav-toggle">
<div class="toggle" aria-label="切换导航栏" role="button">
<span class="toggle-line"></span>
<span class="toggle-line"></span>
<span class="toggle-line"></span>
</div>
</div>
<div class="site-meta">
<a href="/" class="brand" rel="start">
<i class="logo-line"></i>
<h1 class="site-title">人生几何</h1>
<i class="logo-line"></i>
</a>
<p class="site-subtitle" itemprop="description">一个普通程序员的技术博客</p>
</div>
<div class="site-nav-right">
<div class="toggle popup-trigger">
</div>
</div>
</div>
<nav class="site-nav">
<ul class="main-menu menu">
<li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li>
<li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li>
<li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li>
<li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li>
</ul>
</nav>
</div>
<div class="toggle sidebar-toggle" role="button">
<span class="toggle-line"></span>
<span class="toggle-line"></span>
<span class="toggle-line"></span>
</div>
<aside class="sidebar">
<div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
<ul class="sidebar-nav">
<li class="sidebar-nav-toc">
文章目录
</li>
<li class="sidebar-nav-overview">
站点概览
</li>
</ul>
<div class="sidebar-panel-container">
<!--noindex-->
<div class="post-toc-wrap sidebar-panel">
<div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%9D%90%E6%96%99%E6%B8%85%E5%8D%95"><span class="nav-number">1.</span> <span class="nav-text">材料清单</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E8%BF%9E%E7%BA%BF"><span class="nav-number">2.</span> <span class="nav-text">连线</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E9%A9%B1%E5%8A%A8%E4%BB%A3%E7%A0%81"><span class="nav-number">3.</span> <span class="nav-text">驱动代码</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E4%BE%9D%E8%B5%96%E5%BA%93%E5%AE%89%E8%A3%85"><span class="nav-number">3.1.</span> <span class="nav-text">依赖库安装</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E6%8E%A7%E5%88%B6%E9%A3%8E%E6%89%87%E7%9A%84%E4%BB%A3%E7%A0%81"><span class="nav-number">3.2.</span> <span class="nav-text">控制风扇的代码</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E9%85%8D%E7%BD%AE%E5%BC%80%E6%9C%BA%E5%90%AF%E5%8A%A8"><span class="nav-number">3.3.</span> <span class="nav-text">配置开机启动</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%9C%80%E7%BB%88%E6%95%88%E6%9E%9C"><span class="nav-number">4.</span> <span class="nav-text">最终效果</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#%E7%A8%8B%E5%BA%8F%E6%89%A7%E8%A1%8C%E7%9A%84%E6%95%88%E6%9E%9C"><span class="nav-number">4.1.</span> <span class="nav-text">程序执行的效果</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E9%80%9A%E8%BF%87%E6%9C%8D%E5%8A%A1%E7%9A%84%E6%96%B9%E5%BC%8F%E5%BC%80%E5%90%AF%E4%B8%8E%E5%85%B3%E9%97%AD"><span class="nav-number">4.2.</span> <span class="nav-text">通过服务的方式开启与关闭</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#%E8%BF%9E%E7%BA%BF%E5%AE%9E%E7%89%A9%E5%9B%BE"><span class="nav-number">4.3.</span> <span class="nav-text">连线实物图</span></a></li></ol></li></ol></div>
</div>
<!--/noindex-->
<div class="site-overview-wrap sidebar-panel">
<div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
<img class="site-author-image" itemprop="image" alt="dhd"
src="/images/avatar.png">
<p class="site-author-name" itemprop="name">dhd</p>
<div class="site-description" itemprop="description">个人博客,分享一些C/C++ Linux 嵌入式等有趣的技术</div>
</div>
<div class="site-state-wrap site-overview-item animated">
<nav class="site-state">
<div class="site-state-item site-state-posts">
<a href="/archives/">
<span class="site-state-item-count">23</span>
<span class="site-state-item-name">日志</span>
</a>
</div>
<div class="site-state-item site-state-categories">
<a href="/categories/">
<span class="site-state-item-count">12</span>
<span class="site-state-item-name">分类</span></a>
</div>
<div class="site-state-item site-state-tags">
<a href="/tags/">
<span class="site-state-item-count">13</span>
<span class="site-state-item-name">标签</span></a>
</div>
</nav>
</div>
<div class="links-of-author site-overview-item animated">
<span class="links-of-author-item">
<a href="https://github.com/MissYourSmile" title="GitHub → https://github.com/MissYourSmile" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
</span>
<span class="links-of-author-item">
<a href="mailto:[email protected]" title="E-Mail → mailto:[email protected]" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
</span>
</div>
</div>
</div>
</div>
</aside>
<div class="sidebar-dimmer"></div>
</header>
<div class="back-to-top" role="button" aria-label="返回顶部">
<i class="fa fa-arrow-up"></i>
<span>0%</span>
</div>
<noscript>
<div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>
<div class="main-inner post posts-expand">
<div class="post-block">
<article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
<link itemprop="mainEntityOfPage" href="https://renshengjihe.cn/730626e3a078">
<span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
<meta itemprop="image" content="/images/avatar.png">
<meta itemprop="name" content="dhd">
<meta itemprop="description" content="个人博客,分享一些C/C++ Linux 嵌入式等有趣的技术">
</span>
<span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
<meta itemprop="name" content="人生几何">
</span>
<header class="post-header">
<h1 class="post-title" itemprop="name headline">
树莓派折腾日记-自动控制风扇
</h1>
<div class="post-meta-container">
<div class="post-meta">
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar"></i>
</span>
<span class="post-meta-item-text">发表于</span>
<time title="创建时间:2019-07-13 17:08:00" itemprop="dateCreated datePublished" datetime="2019-07-13T17:08:00+08:00">2019-07-13</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-calendar-check"></i>
</span>
<span class="post-meta-item-text">更新于</span>
<time title="修改时间:2021-10-23 00:44:27" itemprop="dateModified" datetime="2021-10-23T00:44:27+08:00">2021-10-23</time>
</span>
<span class="post-meta-item">
<span class="post-meta-item-icon">
<i class="far fa-folder"></i>
</span>
<span class="post-meta-item-text">分类于</span>
<span itemprop="about" itemscope itemtype="http://schema.org/Thing">
<a href="/categories/%E6%A0%91%E8%8E%93%E6%B4%BE/" itemprop="url" rel="index"><span itemprop="name">树莓派</span></a>
</span>
</span>
</div>
<div class="post-description">通过一个三极管配合树莓派的 gpio 接口就实现对树莓派散热风扇的控制,使风扇可以根据 cpu 的温度停止或转动</div>
</div>
</header>
<div class="post-body" itemprop="articleBody">
<p>前段时间买了一只树莓派来玩,在上面配置了一些文件共享服务、闹钟等功能(这些功能后面会在博客写上),开启闹钟的第一天就发生了一个令人头疼的问题,我用的是 3b+ ,所以装了风扇,一晚上下来无数次被风扇的声音吵醒,第二天就把它关掉了。。。。</p>
<p>树莓派装上风扇后噪音会比较大,而且风扇不停地转动会增加耗电,通过一个三极管配合树莓派的 gpio 接口就可以实现对风扇的控制,像笔记本电脑一样,只有在 cpu 需要降温的时候风扇才会转动。</p>
<span id="more"></span>
<p>参考自 <a target="_blank" rel="noopener" href="http://shumeipai.nxez.com/2017/07/13/raspberry-pi-to-achieve-temperature-monitoring-and-control-fan-cooling.html">树莓派实验室</a></p>
<h3 id="材料清单"><a href="#材料清单" class="headerlink" title="材料清单"></a>材料清单</h3><ul>
<li>树莓派 x1</li>
<li>三极管 x1</li>
<li>风扇 x1</li>
<li>面包板 x1 (可选)</li>
<li>杜邦线若干</li>
</ul>
<h3 id="连线"><a href="#连线" class="headerlink" title="连线"></a>连线</h3><p>如图为电路连线图,VCC, GND, GPIO 分别对应树莓派的引脚</p>
<p><img src="https://renshengjihe-1257851699.cos.ap-guangzhou.myqcloud.com/190713-PiTempCtrl/%E8%BF%9E%E7%BA%BF%E5%9B%BE.png" alt="连线图"></p>
<p>如图为树莓派引脚功能图,GPIO 选择树莓派上任意一个 GPIO 接口即可,正负极一定注意别接反了。</p>
<p><img src="https://renshengjihe-1257851699.cos.ap-guangzhou.myqcloud.com/190713-PiTempCtrl/%E5%BC%95%E8%84%9A%E5%9B%BE.png" alt="连线图"></p>
<h3 id="驱动代码"><a href="#驱动代码" class="headerlink" title="驱动代码"></a>驱动代码</h3><h4 id="依赖库安装"><a href="#依赖库安装" class="headerlink" title="依赖库安装"></a>依赖库安装</h4><p>使用下面的代码需首先安装 wiringPi 库。</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">git <span class="built_in">clone</span> git://git.drogon.net/wiringPi</span><br></pre></td></tr></table></figure>
<p>也可以到 <a target="_blank" rel="noopener" href="http://wiringpi.com/">http://wiringpi.com</a> 进行下载</p>
<h4 id="控制风扇的代码"><a href="#控制风扇的代码" class="headerlink" title="控制风扇的代码"></a>控制风扇的代码</h4><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">#!/usr/bin/env python</span></span><br><span class="line"><span class="comment">#coding=utf-8</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> commands,time</span><br><span class="line"></span><br><span class="line">FAN_GPIO = <span class="number">15</span></span><br><span class="line">commands.getoutput(<span class="string">'sudo gpio mode '</span> + <span class="built_in">str</span>(FAN_GPIO) + <span class="string">' out'</span> )</span><br><span class="line"></span><br><span class="line"><span class="keyword">while</span> <span class="literal">True</span>:</span><br><span class="line"> <span class="comment"># 获取当前 cpu 温度</span></span><br><span class="line"> tmpFile = <span class="built_in">open</span>(<span class="string">'/sys/class/thermal/thermal_zone0/temp'</span>)</span><br><span class="line"> cpu_temp_raw = tmpFile.read()</span><br><span class="line"> tmpFile.close()</span><br><span class="line"> cpu_temp = <span class="built_in">round</span>(<span class="built_in">float</span>(cpu_temp_raw) / <span class="number">1000</span>, <span class="number">1</span>)</span><br><span class="line"> <span class="built_in">print</span> cpu_temp</span><br><span class="line"></span><br><span class="line"> <span class="comment"># 大于 50 度,开启风扇降温</span></span><br><span class="line"> <span class="keyword">if</span> cpu_temp >= <span class="number">50.0</span> :</span><br><span class="line"> commands.getoutput(<span class="string">'sudo gpio write '</span> + <span class="built_in">str</span>(FAN_GPIO) + <span class="string">' 0'</span>);</span><br><span class="line"> <span class="comment"># 小于 45 度,关闭风扇</span></span><br><span class="line"> <span class="keyword">if</span> cpu_temp <= <span class="number">45.0</span> :</span><br><span class="line"> commands.getoutput(<span class="string">'sudo gpio write '</span> + <span class="built_in">str</span>(FAN_GPIO) + <span class="string">' 1'</span>);</span><br><span class="line"></span><br><span class="line"> <span class="comment"># 每 10s 检测一次</span></span><br><span class="line"> time.sleep(<span class="number">10</span>)</span><br></pre></td></tr></table></figure>
<h4 id="配置开机启动"><a href="#配置开机启动" class="headerlink" title="配置开机启动"></a>配置开机启动</h4><p>我使用了配置服务的方式实现的开机启动</p>
<p>在 <code>/etc/init.d/</code> 下新建文件 <code>temp_ctrl</code> 并给上执行权限</p>
<p>文件内容如下</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">#!/bin/bash</span></span><br><span class="line"><span class="comment"># /etc/init.d/temp-ctrl</span></span><br><span class="line"><span class="comment"># Default-Start: 2 3 4 5</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">case</span> <span class="string">"<span class="variable">$1</span>"</span> <span class="keyword">in</span></span><br><span class="line"> start)</span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"start temp ctrl"</span></span><br><span class="line"> nohup /home/pi/gpio/fenshan.py &</span><br><span class="line"> ;;</span><br><span class="line"> stop)</span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"stop temp ctrl"</span></span><br><span class="line"> <span class="built_in">kill</span> $(ps aux | grep -m 1 <span class="string">'python /home/pi/gpio/fenshan.py'</span> | awk <span class="string">'{ print $2 }'</span>)</span><br><span class="line"> ;;</span><br><span class="line"> *)</span><br><span class="line"> <span class="built_in">echo</span> <span class="string">"Usage : service temp-ctrl start/stop"</span></span><br><span class="line"> <span class="built_in">exit</span> 1</span><br><span class="line"> ;;</span><br><span class="line"><span class="keyword">esac</span></span><br><span class="line"><span class="built_in">exit</span> 0</span><br></pre></td></tr></table></figure>
<p>在 <code>/etc/rc.local</code> 中 <code>exit 0</code> 之前添加一行 </p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">/etc/init.d/temp_ctrl start</span><br><span class="line"></span><br><span class="line"><span class="built_in">exit</span> 0</span><br></pre></td></tr></table></figure>
<h3 id="最终效果"><a href="#最终效果" class="headerlink" title="最终效果"></a>最终效果</h3><h4 id="程序执行的效果"><a href="#程序执行的效果" class="headerlink" title="程序执行的效果"></a>程序执行的效果</h4><p><img src="https://renshengjihe-1257851699.cos.ap-guangzhou.myqcloud.com/190713-PiTempCtrl/%E6%95%88%E6%9E%9C%E5%9B%BE1.png" alt="连线图"></p>
<h4 id="通过服务的方式开启与关闭"><a href="#通过服务的方式开启与关闭" class="headerlink" title="通过服务的方式开启与关闭"></a>通过服务的方式开启与关闭</h4><p><img src="https://renshengjihe-1257851699.cos.ap-guangzhou.myqcloud.com/190713-PiTempCtrl/%E6%95%88%E6%9E%9C%E5%9B%BE2.png" alt="连线图"></p>
<h4 id="连线实物图"><a href="#连线实物图" class="headerlink" title="连线实物图"></a>连线实物图</h4><p><img src="https://renshengjihe-1257851699.cos.ap-guangzhou.myqcloud.com/190713-PiTempCtrl/%E5%AE%9E%E7%89%A9%E5%9B%BE.jpg" alt="连线图"></p>
</div>
<footer class="post-footer">
<div class="post-tags">
<a href="/tags/%E6%A0%91%E8%8E%93%E6%B4%BE/" rel="tag"># 树莓派</a>
</div>
<div class="post-nav">
<div class="post-nav-item">
<a href="/fe7ffac747de" rel="prev" title="C++继承、多态与虚表分析">
<i class="fa fa-chevron-left"></i> C++继承、多态与虚表分析
</a>
</div>
<div class="post-nav-item">
<a href="/06ae21c2c683" rel="next" title="树莓派折腾日记-数码管显示 ip 地址">
树莓派折腾日记-数码管显示 ip 地址 <i class="fa fa-chevron-right"></i>
</a>
</div>
</div>
</footer>
</article>
</div>
<div class="comments gitalk-container"></div>
</div>
</main>
<footer class="footer">
<div class="footer-inner">
<div class="copyright">
©
<span itemprop="copyrightYear">2021</span>
<span class="with-love">
<i class="fa fa-heart"></i>
</span>
<span class="author" itemprop="copyrightHolder">dhd</span>
</div>
<div class="powered-by">由 <a href="https://hexo.io/" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.js.org/" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
</div>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script>
<script class="next-config" data-name="enableMath" type="application/json">false</script><script class="next-config" data-name="mathjax" type="application/json">{"enable":true,"tags":"none","js":{"url":"https://cdn.jsdelivr.net/npm/[email protected]/es5/tex-mml-chtml.js","integrity":"sha256-r+3itOMtGGjap0x+10hu6jW/gZCzxHsoKrOd7gyRSGY="}}</script>
<script src="/js/third-party/math/mathjax.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/gitalk.css" integrity="sha256-AJnUHL7dBv6PGaeyPQJcgQPDjt/Hn/PvYZde1iqfp8U=" crossorigin="anonymous">
<script class="next-config" data-name="gitalk" type="application/json">{"enable":true,"github_id":"MissYourSmile","repo":"blog","client_id":"90df46a08046f5b73ae9","client_secret":"fa93eaa0abad10d0f79e056b45ba8a0212d37e0d","admin_user":"MissYourSmile","distraction_free_mode":true,"proxy":"https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token","language":"zh-CN","js":{"url":"https://cdn.jsdelivr.net/npm/[email protected]/dist/gitalk.min.js","integrity":"sha256-Pmj85ojLaPOWwRtlMJwmezB/Qg8BzvJp5eTzvXaYAfA="},"path_md5":"46685e028c148e3b814ecfad7c2efc59"}</script>
<script src="/js/third-party/comments/gitalk.js"></script>
</body>
</html>