{"id":56997,"date":"2025-08-15T06:49:32","date_gmt":"2025-08-14T22:49:32","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/56997.html"},"modified":"2025-08-15T06:49:32","modified_gmt":"2025-08-14T22:49:32","slug":"%e4%bc%a0%e6%84%9f%e5%99%a8%e5%ba%94%e7%94%a8%e6%a1%88%e4%be%8b%ef%bc%9a%e5%8e%8b%e5%8a%9b%e4%bc%a0%e6%84%9f%e5%99%a8%e5%9c%a8%e5%b7%a5%e4%b8%9a%e8%87%aa%e5%8a%a8%e5%8c%96%e4%b8%ad%e7%9a%84%e5%ba%94-4","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/56997.html","title":{"rendered":"\u4f20\u611f\u5668\u5e94\u7528\u6848\u4f8b\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u5de5\u4e1a\u81ea\u52a8\u5316\u4e2d\u7684\u5e94\u7528_\uff0819\uff09.\u6848\u4f8b\u5206\u6790\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u5e94\u7528"},"content":{"rendered":"<h2>\u6848\u4f8b\u5206\u6790&#xff1a;\u538b\u529b\u4f20\u611f\u5668\u5728\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u5e94\u7528<\/h2>\n<h3>1. \u5f15\u8a00<\/h3>\n<p>\u5728\u98df\u54c1\u52a0\u5de5\u884c\u4e1a\u4e2d&#xff0c;\u538b\u529b\u4f20\u611f\u5668\u7684\u5e94\u7528\u975e\u5e38\u5e7f\u6cdb&#xff0c;\u4ece\u751f\u4ea7\u8fc7\u7a0b\u7684\u76d1\u63a7\u5230\u8d28\u91cf\u63a7\u5236&#xff0c;\u4ece\u8bbe\u5907\u7ef4\u62a4\u5230\u5b89\u5168\u9632\u62a4&#xff0c;\u538b\u529b\u4f20\u611f\u5668\u90fd\u626e\u6f14\u7740\u81f3\u5173\u91cd\u8981\u7684\u89d2\u8272\u3002\u672c\u8282\u5c06\u8be6\u7ec6\u63a2\u8ba8\u538b\u529b\u4f20\u611f\u5668\u5728\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u5177\u4f53\u5e94\u7528\u6848\u4f8b&#xff0c;\u5305\u62ec\u5728\u996e\u6599\u704c\u88c5\u3001\u8089\u7c7b\u52a0\u5de5\u3001\u70d8\u7119\u548c\u84b8\u716e\u7b49\u73af\u8282\u4e2d\u7684\u5e94\u7528\u3002\u901a\u8fc7\u5177\u4f53\u7684\u5b9e\u4f8b\u548c\u4ee3\u7801\u793a\u4f8b&#xff0c;\u6211\u4eec\u5c06\u6df1\u5165\u7406\u89e3\u5982\u4f55\u5229\u7528\u538b\u529b\u4f20\u611f\u5668\u63d0\u9ad8\u98df\u54c1\u52a0\u5de5\u7684\u6548\u7387\u548c\u8d28\u91cf\u3002<\/p>\n<h3>2. \u538b\u529b\u4f20\u611f\u5668\u5728\u996e\u6599\u704c\u88c5\u4e2d\u7684\u5e94\u7528<\/h3>\n<h4>2.1 \u5e94\u7528\u80cc\u666f<\/h4>\n<p>\u996e\u6599\u704c\u88c5\u662f\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u4e00\u9879\u91cd\u8981\u73af\u8282&#xff0c;\u9700\u8981\u786e\u4fdd\u6bcf\u4e2a\u74f6\u5b50\u91cc\u7684\u996e\u6599\u91cf\u662f\u4e00\u81f4\u7684\u3002\u538b\u529b\u4f20\u611f\u5668\u53ef\u4ee5\u7528\u4e8e\u76d1\u63a7\u704c\u88c5\u8fc7\u7a0b\u4e2d\u7684\u6db2\u4f53\u538b\u529b&#xff0c;\u4ece\u800c\u786e\u4fdd\u6bcf\u4e2a\u74f6\u5b50\u90fd\u704c\u88c5\u5230\u9884\u5b9a\u7684\u91cf\u3002\u6b64\u5916&#xff0c;\u538b\u529b\u4f20\u611f\u5668\u8fd8\u53ef\u4ee5\u7528\u4e8e\u68c0\u6d4b\u7ba1\u9053\u4e2d\u7684\u5835\u585e\u60c5\u51b5&#xff0c;\u786e\u4fdd\u751f\u4ea7\u7ebf\u7684\u987a\u7545\u8fd0\u884c\u3002<\/p>\n<h4>2.2 \u5de5\u4f5c\u539f\u7406<\/h4>\n<p>\u5728\u996e\u6599\u704c\u88c5\u8fc7\u7a0b\u4e2d&#xff0c;\u538b\u529b\u4f20\u611f\u5668\u901a\u5e38\u5b89\u88c5\u5728\u704c\u88c5\u673a\u7684\u7ba1\u9053\u6216\u50a8\u6db2\u7f50\u4e0a\u3002\u5f53\u6db2\u4f53\u901a\u8fc7\u7ba1\u9053\u65f6&#xff0c;\u538b\u529b\u4f20\u611f\u5668\u4f1a\u68c0\u6d4b\u5230\u6db2\u4f53\u7684\u538b\u529b\u53d8\u5316\u3002\u8fd9\u4e9b\u538b\u529b\u53d8\u5316\u53ef\u4ee5\u901a\u8fc7\u4f20\u611f\u5668\u7684\u8f93\u51fa\u4fe1\u53f7&#xff08;\u901a\u5e38\u662f\u7535\u538b\u6216\u6570\u5b57\u4fe1\u53f7&#xff09;\u6765\u8868\u793a&#xff0c;\u5e76\u4f20\u8f93\u5230\u63a7\u5236\u7cfb\u7edf\u3002\u63a7\u5236\u7cfb\u7edf\u6839\u636e\u8fd9\u4e9b\u4fe1\u53f7\u6765\u8c03\u6574\u704c\u88c5\u673a\u7684\u5de5\u4f5c\u53c2\u6570&#xff0c;\u5982\u704c\u88c5\u901f\u5ea6\u548c\u704c\u88c5\u91cf&#xff0c;\u4ee5\u786e\u4fdd\u6bcf\u4e2a\u74f6\u5b50\u7684\u704c\u88c5\u91cf\u4e00\u81f4\u3002<\/p>\n<h4>2.3 \u5177\u4f53\u6848\u4f8b<\/h4>\n<h5>2.3.1 \u6848\u4f8b\u63cf\u8ff0<\/h5>\n<p>\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u996e\u6599\u704c\u88c5\u751f\u4ea7\u7ebf&#xff0c;\u9700\u8981\u786e\u4fdd\u6bcf\u4e2a\u74f6\u5b50\u7684\u704c\u88c5\u91cf\u4e3a500\u6beb\u5347\u3002\u6211\u4eec\u4f7f\u7528\u4e00\u4e2a\u538b\u529b\u4f20\u611f\u5668\u6765\u68c0\u6d4b\u7ba1\u9053\u4e2d\u7684\u6db2\u4f53\u538b\u529b&#xff0c;\u901a\u8fc7\u63a7\u5236\u7cfb\u7edf\u8c03\u6574\u704c\u88c5\u901f\u5ea6\u548c\u65f6\u95f4\u6765\u5b9e\u73b0\u7cbe\u786e\u704c\u88c5\u3002<\/p>\n<h5>2.3.2 \u786c\u4ef6\u914d\u7f6e<\/h5>\n<ul>\n<li>\u538b\u529b\u4f20\u611f\u5668&#xff1a;\u578b\u53f7\u4e3aMPX2050DP&#xff08;\u5dee\u538b\u4f20\u611f\u5668&#xff09;<\/li>\n<li>\u63a7\u5236\u7cfb\u7edf&#xff1a;\u57fa\u4e8eArduino\u7684\u63a7\u5236\u7cfb\u7edf<\/li>\n<li>\u704c\u88c5\u673a&#xff1a;\u81ea\u52a8\u63a7\u5236\u7684\u996e\u6599\u704c\u88c5\u673a<\/li>\n<\/ul>\n<h5>2.3.3 \u4ee3\u7801\u793a\u4f8b<\/h5>\n<p><span class=\"token comment\">\/\/ \u538b\u529b\u4f20\u611f\u5668\u5728\u996e\u6599\u704c\u88c5\u4e2d\u7684\u5e94\u7528\u4ee3\u7801\u793a\u4f8b<\/span><br \/>\n<span class=\"token comment\">\/\/ \u4f7f\u7528Arduino\u548cMPX2050DP\u538b\u529b\u4f20\u611f\u5668<\/span><\/p>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;Wire.h&gt;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;Adafruit_Sensor.h&gt;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;Adafruit_MPL115A2.h&gt;<\/span><\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u521b\u5efa\u538b\u529b\u4f20\u611f\u5668\u5bf9\u8c61<\/span><br \/>\nAdafruit_MPL115A2 mpl <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">Adafruit_MPL115A2<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u5b9a\u4e49\u5e38\u91cf<\/span><br \/>\n<span class=\"token keyword\">const<\/span> <span class=\"token keyword\">int<\/span> pressureSensorPin <span class=\"token operator\">&#061;<\/span> A0<span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u538b\u529b\u4f20\u611f\u5668\u8fde\u63a5\u5230\u6a21\u62df\u8f93\u5165\u5f15\u811aA0<\/span><br \/>\n<span class=\"token keyword\">const<\/span> <span class=\"token keyword\">int<\/span> targetPressure <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">500<\/span><span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">\/\/ \u76ee\u6807\u538b\u529b\u503c&#xff08;\u5355\u4f4d&#xff1a;\u6beb\u5df4&#xff09;<\/span><br \/>\n<span class=\"token keyword\">const<\/span> <span class=\"token keyword\">int<\/span> valveControlPin <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">9<\/span><span class=\"token punctuation\">;<\/span>     <span class=\"token comment\">\/\/ \u63a7\u5236\u9600\u95e8\u7684\u6570\u5b57\u5f15\u811a<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u5b9a\u4e49\u53d8\u91cf<\/span><br \/>\n<span class=\"token keyword\">int<\/span> currentPressure <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>          <span class=\"token comment\">\/\/ \u5f53\u524d\u68c0\u6d4b\u5230\u7684\u538b\u529b\u503c<\/span><br \/>\n<span class=\"token keyword\">int<\/span> valveState <span class=\"token operator\">&#061;<\/span> LOW<span class=\"token punctuation\">;<\/span>             <span class=\"token comment\">\/\/ \u9600\u95e8\u72b6\u6001<\/span><\/p>\n<p><span class=\"token keyword\">void<\/span> <span class=\"token function\">setup<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token comment\">\/\/ \u521d\u59cb\u5316\u4e32\u53e3\u901a\u4fe1<\/span><br \/>\n  Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">begin<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">9600<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>  <span class=\"token comment\">\/\/ \u521d\u59cb\u5316\u538b\u529b\u4f20\u611f\u5668<\/span><br \/>\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>mpl<span class=\"token punctuation\">.<\/span><span class=\"token function\">begin<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">println<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Failed to initialize MPL115A2 sensor!&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">while<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><\/p>\n<p>  <span class=\"token comment\">\/\/ \u8bbe\u7f6e\u9600\u95e8\u63a7\u5236\u5f15\u811a\u4e3a\u8f93\u51fa\u6a21\u5f0f<\/span><br \/>\n  <span class=\"token function\">pinMode<\/span><span class=\"token punctuation\">(<\/span>valveControlPin<span class=\"token punctuation\">,<\/span> OUTPUT<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token function\">digitalWrite<\/span><span class=\"token punctuation\">(<\/span>valveControlPin<span class=\"token punctuation\">,<\/span> valveState<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token keyword\">void<\/span> <span class=\"token function\">loop<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token comment\">\/\/ \u8bfb\u53d6\u538b\u529b\u4f20\u611f\u5668\u7684\u503c<\/span><br \/>\n  mpl<span class=\"token punctuation\">.<\/span><span class=\"token function\">getPressure<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>currentPressure<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Current Pressure: &#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">print<\/span><span class=\"token punctuation\">(<\/span>currentPressure<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">println<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034; mBar&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>  <span class=\"token comment\">\/\/ \u6839\u636e\u538b\u529b\u503c\u8c03\u6574\u9600\u95e8\u72b6\u6001<\/span><br \/>\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>currentPressure <span class=\"token operator\">&lt;<\/span> targetPressure<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    valveState <span class=\"token operator\">&#061;<\/span> HIGH<span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u6253\u5f00\u9600\u95e8<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    valveState <span class=\"token operator\">&#061;<\/span> LOW<span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u5173\u95ed\u9600\u95e8<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><\/p>\n<p>  <span class=\"token comment\">\/\/ \u63a7\u5236\u9600\u95e8<\/span><br \/>\n  <span class=\"token function\">digitalWrite<\/span><span class=\"token punctuation\">(<\/span>valveControlPin<span class=\"token punctuation\">,<\/span> valveState<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>  <span class=\"token comment\">\/\/ \u5ef6\u8fdf100\u6beb\u79d2<\/span><br \/>\n  <span class=\"token function\">delay<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">100<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h4>2.4 \u6570\u636e\u6837\u4f8b<\/h4>\n<p>\u5047\u8bbe\u6211\u4eec\u8bb0\u5f55\u4e8610\u4e2a\u74f6\u5b50\u704c\u88c5\u8fc7\u7a0b\u4e2d\u7684\u538b\u529b\u6570\u636e\u5982\u4e0b&#xff1a;<\/p>\n<table>\n<tr>\u74f6\u5b50\u7f16\u53f7\u704c\u88c5\u538b\u529b (mBar)<\/tr>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>480<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>500<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>495<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>505<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>500<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>498<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>502<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>500<\/td>\n<\/tr>\n<tr>\n<td>9<\/td>\n<td>495<\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>500<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u901a\u8fc7\u8fd9\u4e9b\u6570\u636e&#xff0c;\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u6bcf\u4e2a\u74f6\u5b50\u7684\u704c\u88c5\u538b\u529b\u90fd\u5728\u76ee\u6807\u538b\u529b\u503c\u9644\u8fd1&#xff0c;\u786e\u4fdd\u4e86\u704c\u88c5\u91cf\u7684\u4e00\u81f4\u6027\u3002<\/p>\n<h3>3. \u538b\u529b\u4f20\u611f\u5668\u5728\u8089\u7c7b\u52a0\u5de5\u4e2d\u7684\u5e94\u7528<\/h3>\n<h4>3.1 \u5e94\u7528\u80cc\u666f<\/h4>\n<p>\u5728\u8089\u7c7b\u52a0\u5de5\u8fc7\u7a0b\u4e2d&#xff0c;\u538b\u529b\u4f20\u611f\u5668\u53ef\u4ee5\u7528\u4e8e\u76d1\u63a7\u8089\u7c7b\u7684\u538b\u69a8\u8fc7\u7a0b&#xff0c;\u786e\u4fdd\u8089\u5757\u7684\u5bc6\u5ea6\u548c\u5f62\u72b6\u7b26\u5408\u6807\u51c6\u3002\u6b64\u5916&#xff0c;\u538b\u529b\u4f20\u611f\u5668\u8fd8\u53ef\u4ee5\u7528\u4e8e\u68c0\u6d4b\u5305\u88c5\u8fc7\u7a0b\u4e2d\u7684\u538b\u529b&#xff0c;\u786e\u4fdd\u5305\u88c5\u888b\u5bc6\u5c01\u826f\u597d&#xff0c;\u9632\u6b62\u8089\u7c7b\u53d8\u8d28\u3002<\/p>\n<h4>3.2 \u5de5\u4f5c\u539f\u7406<\/h4>\n<p>\u5728\u8089\u7c7b\u538b\u69a8\u8fc7\u7a0b\u4e2d&#xff0c;\u538b\u529b\u4f20\u611f\u5668\u5b89\u88c5\u5728\u538b\u69a8\u8bbe\u5907\u7684\u538b\u677f\u4e0a&#xff0c;\u7528\u4e8e\u68c0\u6d4b\u538b\u677f\u5bf9\u8089\u5757\u65bd\u52a0\u7684\u538b\u529b\u3002\u8fd9\u4e9b\u538b\u529b\u6570\u636e\u88ab\u4f20\u8f93\u5230\u63a7\u5236\u7cfb\u7edf&#xff0c;\u63a7\u5236\u7cfb\u7edf\u6839\u636e\u538b\u529b\u503c\u8c03\u6574\u538b\u677f\u7684\u4e0b\u538b\u529b&#xff0c;\u4ee5\u786e\u4fdd\u8089\u5757\u7684\u5bc6\u5ea6\u548c\u5f62\u72b6\u7b26\u5408\u8981\u6c42\u3002\u5728\u5305\u88c5\u8fc7\u7a0b\u4e2d&#xff0c;\u538b\u529b\u4f20\u611f\u5668\u5b89\u88c5\u5728\u5305\u88c5\u673a\u7684\u5bc6\u5c01\u88c5\u7f6e\u4e0a&#xff0c;\u7528\u4e8e\u68c0\u6d4b\u5bc6\u5c01\u8fc7\u7a0b\u4e2d\u7684\u538b\u529b&#xff0c;\u786e\u4fdd\u5305\u88c5\u888b\u5bc6\u5c01\u826f\u597d\u3002<\/p>\n<h4>3.3 \u5177\u4f53\u6848\u4f8b<\/h4>\n<h5>3.3.1 \u6848\u4f8b\u63cf\u8ff0<\/h5>\n<p>\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u8089\u7c7b\u538b\u69a8\u8bbe\u5907&#xff0c;\u9700\u8981\u786e\u4fdd\u8089\u5757\u7684\u5bc6\u5ea6\u57281.2 g\/cm\u00b3\u5de6\u53f3\u3002\u6211\u4eec\u4f7f\u7528\u4e00\u4e2a\u538b\u529b\u4f20\u611f\u5668\u6765\u68c0\u6d4b\u538b\u677f\u5bf9\u8089\u5757\u65bd\u52a0\u7684\u538b\u529b&#xff0c;\u5e76\u901a\u8fc7\u63a7\u5236\u7cfb\u7edf\u8c03\u6574\u538b\u677f\u7684\u4e0b\u538b\u529b\u3002<\/p>\n<h5>3.3.2 \u786c\u4ef6\u914d\u7f6e<\/h5>\n<ul>\n<li>\u538b\u529b\u4f20\u611f\u5668&#xff1a;\u578b\u53f7\u4e3aHoneywell SS510N&#xff08;\u538b\u529b\u4f20\u611f\u5668&#xff09;<\/li>\n<li>\u63a7\u5236\u7cfb\u7edf&#xff1a;\u57fa\u4e8eRaspberry Pi\u7684\u63a7\u5236\u7cfb\u7edf<\/li>\n<li>\u538b\u69a8\u8bbe\u5907&#xff1a;\u81ea\u52a8\u63a7\u5236\u7684\u8089\u7c7b\u538b\u69a8\u673a<\/li>\n<\/ul>\n<h5>3.3.3 \u4ee3\u7801\u793a\u4f8b<\/h5>\n<p><span class=\"token comment\"># \u538b\u529b\u4f20\u611f\u5668\u5728\u8089\u7c7b\u52a0\u5de5\u4e2d\u7684\u5e94\u7528\u4ee3\u7801\u793a\u4f8b<\/span><br \/>\n<span class=\"token comment\"># \u4f7f\u7528Raspberry Pi\u548cHoneywell SS510N\u538b\u529b\u4f20\u611f\u5668<\/span><\/p>\n<p><span class=\"token keyword\">import<\/span> spidev<br \/>\n<span class=\"token keyword\">import<\/span> time<\/p>\n<p><span class=\"token comment\"># \u521d\u59cb\u5316SPI\u63a5\u53e3<\/span><br \/>\nspi <span class=\"token operator\">&#061;<\/span> spidev<span class=\"token punctuation\">.<\/span>SpiDev<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\nspi<span class=\"token punctuation\">.<\/span><span class=\"token builtin\">open<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><br \/>\nspi<span class=\"token punctuation\">.<\/span>max_speed_hz <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1000000<\/span><\/p>\n<p><span class=\"token comment\"># \u5b9a\u4e49\u5e38\u91cf<\/span><br \/>\nPRESSURE_SENSOR_CHANNEL <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span>  <span class=\"token comment\"># \u538b\u529b\u4f20\u611f\u5668\u8fde\u63a5\u5230SPI\u901a\u90530<\/span><br \/>\nTARGET_DENSITY <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1.2<\/span>        <span class=\"token comment\"># \u76ee\u6807\u5bc6\u5ea6&#xff08;\u5355\u4f4d&#xff1a;g\/cm\u00b3&#xff09;<\/span><br \/>\nPRESSURE_TO_DENSITY_FACTOR <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0.001<\/span>  <span class=\"token comment\"># \u538b\u529b\u5230\u5bc6\u5ea6\u7684\u8f6c\u6362\u56e0\u5b50<\/span><\/p>\n<p><span class=\"token comment\"># \u5b9a\u4e49\u53d8\u91cf<\/span><br \/>\ncurrent_density <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0.0<\/span>  <span class=\"token comment\"># \u5f53\u524d\u68c0\u6d4b\u5230\u7684\u5bc6\u5ea6<\/span><br \/>\nvalve_state <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">False<\/span>    <span class=\"token comment\"># \u538b\u677f\u72b6\u6001<\/span><\/p>\n<p><span class=\"token keyword\">def<\/span> read<span class=\"token operator\">&#8211;<\/span>pressure_sensor<span class=\"token punctuation\">(<\/span>channel<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token triple-quoted-string string\">&#034;&#034;&#034;<br \/>\n    \u8bfb\u53d6\u538b\u529b\u4f20\u611f\u5668\u7684\u503c<br \/>\n    :param channel: \u4f20\u611f\u5668\u8fde\u63a5\u7684SPI\u901a\u9053<br \/>\n    :return: \u538b\u529b\u503c&#xff08;\u5355\u4f4d&#xff1a;mBar&#xff09;<br \/>\n    &#034;&#034;&#034;<\/span><br \/>\n    <span class=\"token comment\"># \u8bfb\u53d6SPI\u6570\u636e<\/span><br \/>\n    raw_value <span class=\"token operator\">&#061;<\/span> spi<span class=\"token punctuation\">.<\/span>xfer2<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">8<\/span> <span class=\"token operator\">&#043;<\/span> channel<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token number\">4<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token comment\"># \u8f6c\u6362\u4e3a10\u4f4d\u7684ADC\u503c<\/span><br \/>\n    adc_value <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span>raw_value<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&amp;<\/span> <span class=\"token number\">3<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token number\">8<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#043;<\/span> raw_value<span class=\"token punctuation\">[<\/span><span class=\"token number\">2<\/span><span class=\"token punctuation\">]<\/span><br \/>\n    <span class=\"token comment\"># \u8f6c\u6362\u4e3a\u538b\u529b\u503c<\/span><br \/>\n    pressure_value <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">(<\/span>adc_value <span class=\"token operator\">\/<\/span> <span class=\"token number\">1023.0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">*<\/span> <span class=\"token number\">1000.0<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> pressure_value<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">control_valve<\/span><span class=\"token punctuation\">(<\/span>pressure<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token triple-quoted-string string\">&#034;&#034;&#034;<br \/>\n    \u6839\u636e\u538b\u529b\u503c\u8c03\u6574\u538b\u677f\u72b6\u6001<br \/>\n    :param pressure: \u538b\u529b\u503c&#xff08;\u5355\u4f4d&#xff1a;mBar&#xff09;<br \/>\n    &#034;&#034;&#034;<\/span><br \/>\n    <span class=\"token keyword\">global<\/span> valve_state<br \/>\n    density <span class=\"token operator\">&#061;<\/span> pressure <span class=\"token operator\">*<\/span> PRESSURE_TO_DENSITY_FACTOR<br \/>\n    <span class=\"token keyword\">if<\/span> density <span class=\"token operator\">&lt;<\/span> TARGET_DENSITY<span class=\"token punctuation\">:<\/span><br \/>\n        valve_state <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">True<\/span>  <span class=\"token comment\"># \u589e\u52a0\u4e0b\u538b\u529b<\/span><br \/>\n    <span class=\"token keyword\">else<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        valve_state <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">False<\/span>  <span class=\"token comment\"># \u51cf\u5c11\u4e0b\u538b\u529b<\/span><\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">while<\/span> <span class=\"token boolean\">True<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token comment\"># \u8bfb\u53d6\u538b\u529b\u4f20\u611f\u5668\u7684\u503c<\/span><br \/>\n        current_pressure <span class=\"token operator\">&#061;<\/span> read_pressure_sensor<span class=\"token punctuation\">(<\/span>PRESSURE_SENSOR_CHANNEL<span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;Current Pressure: <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>current_pressure<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> mBar&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>        <span class=\"token comment\"># \u6839\u636e\u538b\u529b\u503c\u8c03\u6574\u538b\u677f\u72b6\u6001<\/span><br \/>\n        control_valve<span class=\"token punctuation\">(<\/span>current_pressure<span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;Valve State: <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span><span class=\"token string\">&#039;Open&#039;<\/span> <span class=\"token keyword\">if<\/span> valve_state <span class=\"token keyword\">else<\/span> <span class=\"token string\">&#039;Closed&#039;<\/span><span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>        <span class=\"token comment\"># \u5ef6\u8fdf1\u79d2<\/span><br \/>\n        time<span class=\"token punctuation\">.<\/span>sleep<span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">if<\/span> __name__ <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#034;__main__&#034;<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    main<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<h4>3.4 \u6570\u636e\u6837\u4f8b<\/h4>\n<p>\u5047\u8bbe\u6211\u4eec\u8bb0\u5f55\u4e8610\u6b21\u538b\u69a8\u8fc7\u7a0b\u4e2d\u7684\u538b\u529b\u6570\u636e\u5982\u4e0b&#xff1a;<\/p>\n<table>\n<tr>\u538b\u69a8\u6b21\u6570\u538b\u529b (mBar)\u5bc6\u5ea6 (g\/cm\u00b3)<\/tr>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>1190<\/td>\n<td>1.190<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>1200<\/td>\n<td>1.200<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>1195<\/td>\n<td>1.195<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>1205<\/td>\n<td>1.205<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>1200<\/td>\n<td>1.200<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>1198<\/td>\n<td>1.198<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>1202<\/td>\n<td>1.202<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>1200<\/td>\n<td>1.200<\/td>\n<\/tr>\n<tr>\n<td>9<\/td>\n<td>1195<\/td>\n<td>1.195<\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>1200<\/td>\n<td>1.200<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u901a\u8fc7\u8fd9\u4e9b\u6570\u636e&#xff0c;\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u6bcf\u6b21\u538b\u69a8\u8fc7\u7a0b\u4e2d\u7684\u538b\u529b\u548c\u5bc6\u5ea6\u90fd\u5728\u76ee\u6807\u503c\u9644\u8fd1&#xff0c;\u786e\u4fdd\u4e86\u8089\u5757\u7684\u5bc6\u5ea6\u548c\u5f62\u72b6\u7b26\u5408\u8981\u6c42\u3002<\/p>\n<h3>4. \u538b\u529b\u4f20\u611f\u5668\u5728\u70d8\u7119\u4e2d\u7684\u5e94\u7528<\/h3>\n<h4>4.1 \u5e94\u7528\u80cc\u666f<\/h4>\n<p>\u5728\u70d8\u7119\u8fc7\u7a0b\u4e2d&#xff0c;\u538b\u529b\u4f20\u611f\u5668\u53ef\u4ee5\u7528\u4e8e\u76d1\u63a7\u70e4\u7bb1\u7684\u6c14\u538b&#xff0c;\u786e\u4fdd\u9762\u56e2\u5728\u9002\u5f53\u7684\u6c14\u538b\u4e0b\u81a8\u80c0\u3002\u6b64\u5916&#xff0c;\u538b\u529b\u4f20\u611f\u5668\u8fd8\u53ef\u4ee5\u7528\u4e8e\u68c0\u6d4b\u70e4\u76d8\u7684\u538b\u529b&#xff0c;\u786e\u4fdd\u9762\u56e2\u5728\u70e4\u5236\u8fc7\u7a0b\u4e2d\u53d7\u5230\u5747\u5300\u7684\u538b\u529b\u3002<\/p>\n<h4>4.2 \u5de5\u4f5c\u539f\u7406<\/h4>\n<p>\u5728\u70e4\u7bb1\u4e2d&#xff0c;\u538b\u529b\u4f20\u611f\u5668\u5b89\u88c5\u5728\u70e4\u7bb1\u7684\u6c14\u538b\u5ba4\u4e2d&#xff0c;\u7528\u4e8e\u68c0\u6d4b\u70e4\u7bb1\u5185\u90e8\u7684\u6c14\u538b\u3002\u8fd9\u4e9b\u6c14\u538b\u6570\u636e\u88ab\u4f20\u8f93\u5230\u63a7\u5236\u7cfb\u7edf&#xff0c;\u63a7\u5236\u7cfb\u7edf\u6839\u636e\u6c14\u538b\u503c\u8c03\u6574\u70e4\u7bb1\u7684\u6c14\u538b&#xff0c;\u4ee5\u786e\u4fdd\u9762\u56e2\u5728\u9002\u5f53\u7684\u6c14\u538b\u4e0b\u81a8\u80c0\u3002\u5728\u70e4\u76d8\u4e2d&#xff0c;\u538b\u529b\u4f20\u611f\u5668\u5b89\u88c5\u5728\u70e4\u76d8\u7684\u5e95\u90e8&#xff0c;\u7528\u4e8e\u68c0\u6d4b\u70e4\u76d8\u5bf9\u9762\u56e2\u65bd\u52a0\u7684\u538b\u529b&#xff0c;\u786e\u4fdd\u9762\u56e2\u5728\u70e4\u5236\u8fc7\u7a0b\u4e2d\u53d7\u5230\u5747\u5300\u7684\u538b\u529b\u3002<\/p>\n<h4>4.3 \u5177\u4f53\u6848\u4f8b<\/h4>\n<h5>4.3.1 \u6848\u4f8b\u63cf\u8ff0<\/h5>\n<p>\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u70d8\u7119\u751f\u4ea7\u7ebf&#xff0c;\u9700\u8981\u786e\u4fdd\u70e4\u7bb1\u5185\u90e8\u7684\u6c14\u538b\u57281.013 kPa&#xff08;\u6807\u51c6\u5927\u6c14\u538b&#xff09;\u9644\u8fd1&#xff0c;\u4ee5\u786e\u4fdd\u9762\u56e2\u5728\u9002\u5f53\u7684\u6c14\u538b\u4e0b\u81a8\u80c0\u3002\u540c\u65f6&#xff0c;\u6211\u4eec\u8fd8\u9700\u8981\u786e\u4fdd\u70e4\u76d8\u5bf9\u9762\u56e2\u65bd\u52a0\u7684\u538b\u529b\u5728100 g\/cm\u00b2\u5de6\u53f3&#xff0c;\u4ee5\u786e\u4fdd\u9762\u56e2\u5728\u70e4\u5236\u8fc7\u7a0b\u4e2d\u53d7\u5230\u5747\u5300\u7684\u538b\u529b\u3002<\/p>\n<h5>4.3.2 \u786c\u4ef6\u914d\u7f6e<\/h5>\n<ul>\n<li>\u538b\u529b\u4f20\u611f\u56681&#xff1a;\u578b\u53f7\u4e3aMPX5010DP&#xff08;\u7528\u4e8e\u68c0\u6d4b\u70e4\u7bb1\u6c14\u538b&#xff09;<\/li>\n<li>\u538b\u529b\u4f20\u611f\u56682&#xff1a;\u578b\u53f7\u4e3aFSG15N2A1M&#xff08;\u7528\u4e8e\u68c0\u6d4b\u70e4\u76d8\u538b\u529b&#xff09;<\/li>\n<li>\u63a7\u5236\u7cfb\u7edf&#xff1a;\u57fa\u4e8eRaspberry Pi\u7684\u63a7\u5236\u7cfb\u7edf<\/li>\n<li>\u70e4\u7bb1\u548c\u70e4\u76d8&#xff1a;\u81ea\u52a8\u63a7\u5236\u7684\u70d8\u7119\u8bbe\u5907<\/li>\n<\/ul>\n<h5>4.3.3 \u4ee3\u7801\u793a\u4f8b<\/h5>\n<p><span class=\"token comment\"># \u538b\u529b\u4f20\u611f\u5668\u5728\u70d8\u7119\u4e2d\u7684\u5e94\u7528\u4ee3\u7801\u793a\u4f8b<\/span><br \/>\n<span class=\"token comment\"># \u4f7f\u7528Raspberry Pi\u548c\u4e24\u4e2a\u538b\u529b\u4f20\u611f\u5668<\/span><\/p>\n<p><span class=\"token keyword\">import<\/span> spidev<br \/>\n<span class=\"token keyword\">import<\/span> time<\/p>\n<p><span class=\"token comment\"># \u521d\u59cb\u5316SPI\u63a5\u53e3<\/span><br \/>\nspi <span class=\"token operator\">&#061;<\/span> spidev<span class=\"token punctuation\">.<\/span>SpiDev<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\nspi<span class=\"token punctuation\">.<\/span><span class=\"token builtin\">open<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><br \/>\nspi<span class=\"token punctuation\">.<\/span>max_speed_hz <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1000000<\/span><\/p>\n<p><span class=\"token comment\"># \u5b9a\u4e49\u5e38\u91cf<\/span><br \/>\nPRESSURE_SENSOR_CHANNEL_1 <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span>  <span class=\"token comment\"># \u70e4\u7bb1\u6c14\u538b\u4f20\u611f\u5668\u8fde\u63a5\u5230SPI\u901a\u90530<\/span><br \/>\nPRESSURE_SENSOR_CHANNEL_2 <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1<\/span>  <span class=\"token comment\"># \u70e4\u76d8\u538b\u529b\u4f20\u611f\u5668\u8fde\u63a5\u5230SPI\u901a\u90531<\/span><br \/>\nTARGET_AIR_PRESSURE <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1.013<\/span>    <span class=\"token comment\"># \u76ee\u6807\u6c14\u538b&#xff08;\u5355\u4f4d&#xff1a;kPa&#xff09;<\/span><br \/>\nTARGET_BAKING_PRESSURE <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">100<\/span>   <span class=\"token comment\"># \u76ee\u6807\u70e4\u76d8\u538b\u529b&#xff08;\u5355\u4f4d&#xff1a;g\/cm\u00b2&#xff09;<\/span><br \/>\nAIR_PRESSURE_FACTOR <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0.001<\/span>    <span class=\"token comment\"># \u6c14\u538b\u4f20\u611f\u5668\u7684\u8f6c\u6362\u56e0\u5b50<\/span><br \/>\nBAKING_PRESSURE_FACTOR <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1.0<\/span>    <span class=\"token comment\"># \u70e4\u76d8\u538b\u529b\u4f20\u611f\u5668\u7684\u8f6c\u6362\u56e0\u5b50<\/span><\/p>\n<p><span class=\"token comment\"># \u5b9a\u4e49\u53d8\u91cf<\/span><br \/>\ncurrent_air_pressure <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0.0<\/span>  <span class=\"token comment\"># \u5f53\u524d\u68c0\u6d4b\u5230\u7684\u6c14\u538b<\/span><br \/>\ncurrent_baking_pressure <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0.0<\/span>  <span class=\"token comment\"># \u5f53\u524d\u68c0\u6d4b\u5230\u7684\u70e4\u76d8\u538b\u529b<\/span><br \/>\nvalve_state_1 <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">False<\/span>  <span class=\"token comment\"># \u6c14\u538b\u8c03\u8282\u9600\u95e8\u72b6\u6001<\/span><br \/>\nvalve_state_2 <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">False<\/span>  <span class=\"token comment\"># \u70e4\u76d8\u538b\u529b\u8c03\u8282\u9600\u95e8\u72b6\u6001<\/span><\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">read_pressure_sensor<\/span><span class=\"token punctuation\">(<\/span>channel<span class=\"token punctuation\">,<\/span> factor<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token triple-quoted-string string\">&#034;&#034;&#034;<br \/>\n    \u8bfb\u53d6\u538b\u529b\u4f20\u611f\u5668\u7684\u503c\u5e76\u8f6c\u6362\u4e3a\u5b9e\u9645\u538b\u529b<br \/>\n    :param channel: \u4f20\u611f\u5668\u8fde\u63a5\u7684SPI\u901a\u9053<br \/>\n    :param factor: \u538b\u529b\u8f6c\u6362\u56e0\u5b50<br \/>\n    :return: \u538b\u529b\u503c<br \/>\n    &#034;&#034;&#034;<\/span><br \/>\n    <span class=\"token comment\"># \u8bfb\u53d6SPI\u6570\u636e<\/span><br \/>\n    raw_value <span class=\"token operator\">&#061;<\/span> spi<span class=\"token punctuation\">.<\/span>xfer2<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">8<\/span> <span class=\"token operator\">&#043;<\/span> channel<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token number\">4<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token comment\"># \u8f6c\u6362\u4e3a10\u4f4d\u7684ADC\u503c<\/span><br \/>\n    adc_value <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">(<\/span>raw_value<span class=\"token punctuation\">[<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&amp;<\/span> <span class=\"token number\">3<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&lt;&lt;<\/span> <span class=\"token number\">8<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&#043;<\/span> raw_value<span class=\"token punctuation\">[<\/span><span class=\"token number\">2<\/span><span class=\"token punctuation\">]<\/span><br \/>\n    <span class=\"token comment\"># \u8f6c\u6362\u4e3a\u5b9e\u9645\u538b\u529b\u503c<\/span><br \/>\n    pressure_value <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">(<\/span>adc_value <span class=\"token operator\">\/<\/span> <span class=\"token number\">1023.0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">*<\/span> <span class=\"token number\">1000.0<\/span> <span class=\"token operator\">*<\/span> factor<br \/>\n    <span class=\"token keyword\">return<\/span> pressure_value<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">control_valve<\/span><span class=\"token punctuation\">(<\/span>pressure<span class=\"token punctuation\">,<\/span> target_pressure<span class=\"token punctuation\">,<\/span> valve_state<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token triple-quoted-string string\">&#034;&#034;&#034;<br \/>\n    \u6839\u636e\u538b\u529b\u503c\u8c03\u6574\u9600\u95e8\u72b6\u6001<br \/>\n    :param pressure: \u5f53\u524d\u538b\u529b\u503c<br \/>\n    :param target_pressure: \u76ee\u6807\u538b\u529b\u503c<br \/>\n    :param valve_state: \u9600\u95e8\u72b6\u6001<br \/>\n    :return: \u8c03\u6574\u540e\u7684\u9600\u95e8\u72b6\u6001<br \/>\n    &#034;&#034;&#034;<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> pressure <span class=\"token operator\">&lt;<\/span> target_pressure<span class=\"token punctuation\">:<\/span><br \/>\n        valve_state <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">True<\/span>  <span class=\"token comment\"># \u6253\u5f00\u9600\u95e8<\/span><br \/>\n    <span class=\"token keyword\">else<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        valve_state <span class=\"token operator\">&#061;<\/span> <span class=\"token boolean\">False<\/span>  <span class=\"token comment\"># \u5173\u95ed\u9600\u95e8<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> valve_state<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">while<\/span> <span class=\"token boolean\">True<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token comment\"># \u8bfb\u53d6\u70e4\u7bb1\u6c14\u538b\u4f20\u611f\u5668\u7684\u503c<\/span><br \/>\n        current_air_pressure <span class=\"token operator\">&#061;<\/span> read_pressure_sensor<span class=\"token punctuation\">(<\/span>PRESSURE_SENSOR_CHANNEL_1<span class=\"token punctuation\">,<\/span> AIR_PRESSURE_FACTOR<span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;Current Air Pressure: <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>current_air_pressure<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> kPa&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>        <span class=\"token comment\"># \u6839\u636e\u6c14\u538b\u503c\u8c03\u6574\u6c14\u538b\u8c03\u8282\u9600\u95e8\u72b6\u6001<\/span><br \/>\n        valve_state_1 <span class=\"token operator\">&#061;<\/span> control_valve<span class=\"token punctuation\">(<\/span>current_air_pressure<span class=\"token punctuation\">,<\/span> TARGET_AIR_PRESSURE<span class=\"token punctuation\">,<\/span> valve_state_1<span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;Air Valve State: <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span><span class=\"token string\">&#039;Open&#039;<\/span> <span class=\"token keyword\">if<\/span> valve_state_1 <span class=\"token keyword\">else<\/span> <span class=\"token string\">&#039;Closed&#039;<\/span><span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>        <span class=\"token comment\"># \u8bfb\u53d6\u70e4\u76d8\u538b\u529b\u4f20\u611f\u5668\u7684\u503c<\/span><br \/>\n        current_baking_pressure <span class=\"token operator\">&#061;<\/span> read_pressure_sensor<span class=\"token punctuation\">(<\/span>PRESSURE_SENSOR_CHANNEL_2<span class=\"token punctuation\">,<\/span> BAKING_PRESSURE_FACTOR<span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;Current Baking Pressure: <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>current_baking_pressure<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> g\/cm\u00b2&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>        <span class=\"token comment\"># \u6839\u636e\u70e4\u76d8\u538b\u529b\u503c\u8c03\u6574\u70e4\u76d8\u538b\u529b\u8c03\u8282\u9600\u95e8\u72b6\u6001<\/span><br \/>\n        valve_state_2 <span class=\"token operator\">&#061;<\/span> control_valve<span class=\"token punctuation\">(<\/span>current_baking_pressure<span class=\"token punctuation\">,<\/span> TARGET_BAKING_PRESSURE<span class=\"token punctuation\">,<\/span> valve_state_2<span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;Baking Valve State: <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span><span class=\"token string\">&#039;Open&#039;<\/span> <span class=\"token keyword\">if<\/span> valve_state_2 <span class=\"token keyword\">else<\/span> <span class=\"token string\">&#039;Closed&#039;<\/span><span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>        <span class=\"token comment\"># \u5ef6\u8fdf1\u79d2<\/span><br \/>\n        time<span class=\"token punctuation\">.<\/span>sleep<span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">if<\/span> __name__ <span class=\"token operator\">&#061;&#061;<\/span> <span class=\"token string\">&#034;__main__&#034;<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    main<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<h4>4.4 \u6570\u636e\u6837\u4f8b<\/h4>\n<p>\u5047\u8bbe\u6211\u4eec\u8bb0\u5f55\u4e8610\u6b21\u70d8\u7119\u8fc7\u7a0b\u4e2d\u7684\u6c14\u538b\u548c\u70e4\u76d8\u538b\u529b\u6570\u636e\u5982\u4e0b&#xff1a;<\/p>\n<table>\n<tr>\u70d8\u7119\u6b21\u6570\u6c14\u538b (kPa)\u70e4\u76d8\u538b\u529b (g\/cm\u00b2)<\/tr>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>1.010<\/td>\n<td>98<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>1.013<\/td>\n<td>100<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>1.012<\/td>\n<td>99<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>1.014<\/td>\n<td>101<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>1.013<\/td>\n<td>100<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>1.011<\/td>\n<td>98<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>1.015<\/td>\n<td>101<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>1.013<\/td>\n<td>100<\/td>\n<\/tr>\n<tr>\n<td>9<\/td>\n<td>1.012<\/td>\n<td>99<\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>1.013<\/td>\n<td>100<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u901a\u8fc7\u8fd9\u4e9b\u6570\u636e&#xff0c;\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u6bcf\u6b21\u70d8\u7119\u8fc7\u7a0b\u4e2d\u7684\u6c14\u538b\u548c\u70e4\u76d8\u538b\u529b\u90fd\u5728\u76ee\u6807\u503c\u9644\u8fd1&#xff0c;\u786e\u4fdd\u4e86\u9762\u56e2\u7684\u81a8\u80c0\u548c\u70e4\u5236\u8fc7\u7a0b\u7684\u8d28\u91cf\u3002<\/p>\n<h3>5. \u538b\u529b\u4f20\u611f\u5668\u5728\u84b8\u716e\u4e2d\u7684\u5e94\u7528<\/h3>\n<h4>5.1 \u5e94\u7528\u80cc\u666f<\/h4>\n<p>\u5728\u84b8\u716e\u8fc7\u7a0b\u4e2d&#xff0c;\u538b\u529b\u4f20\u611f\u5668\u53ef\u4ee5\u7528\u4e8e\u76d1\u63a7\u84b8\u6c7d\u538b\u529b&#xff0c;\u786e\u4fdd\u98df\u54c1\u5728\u9002\u5f53\u7684\u84b8\u6c7d\u538b\u529b\u4e0b\u8fdb\u884c\u84b8\u716e\u3002\u6b64\u5916&#xff0c;\u538b\u529b\u4f20\u611f\u5668\u8fd8\u53ef\u4ee5\u7528\u4e8e\u68c0\u6d4b\u84b8\u6c7d\u7ba1\u9053\u7684\u538b\u529b&#xff0c;\u786e\u4fdd\u84b8\u6c7d\u7684\u5747\u5300\u5206\u5e03\u548c\u5b89\u5168\u8fd0\u884c\u3002\u901a\u8fc7\u7cbe\u786e\u7684\u538b\u529b\u63a7\u5236&#xff0c;\u53ef\u4ee5\u63d0\u9ad8\u98df\u54c1\u7684\u84b8\u716e\u8d28\u91cf\u548c\u751f\u4ea7\u6548\u7387&#xff0c;\u540c\u65f6\u51cf\u5c11\u8bbe\u5907\u6545\u969c\u548c\u5b89\u5168\u9690\u60a3\u3002<\/p>\n<h4>5.2 \u5de5\u4f5c\u539f\u7406<\/h4>\n<p>\u5728\u84b8\u716e\u8bbe\u5907\u4e2d&#xff0c;\u538b\u529b\u4f20\u611f\u5668\u5b89\u88c5\u5728\u84b8\u6c7d\u53d1\u751f\u5668\u548c\u7ba1\u9053\u4e2d&#xff0c;\u7528\u4e8e\u68c0\u6d4b\u84b8\u6c7d\u7684\u538b\u529b\u3002\u8fd9\u4e9b\u538b\u529b\u6570\u636e\u88ab\u4f20\u8f93\u5230\u63a7\u5236\u7cfb\u7edf&#xff0c;\u63a7\u5236\u7cfb\u7edf\u6839\u636e\u538b\u529b\u503c\u8c03\u6574\u84b8\u6c7d\u53d1\u751f\u5668\u7684\u5de5\u4f5c\u53c2\u6570&#xff0c;\u5982\u84b8\u6c7d\u751f\u6210\u901f\u5ea6\u548c\u6e29\u5ea6&#xff0c;\u4ee5\u786e\u4fdd\u98df\u54c1\u5728\u9002\u5f53\u7684\u84b8\u6c7d\u538b\u529b\u4e0b\u8fdb\u884c\u84b8\u716e\u3002\u540c\u65f6&#xff0c;\u63a7\u5236\u7cfb\u7edf\u8fd8\u53ef\u4ee5\u6839\u636e\u7ba1\u9053\u4e2d\u7684\u538b\u529b\u503c\u8c03\u6574\u84b8\u6c7d\u9600\u95e8\u7684\u5f00\u95ed&#xff0c;\u786e\u4fdd\u84b8\u6c7d\u7684\u5747\u5300\u5206\u5e03\u548c\u5b89\u5168\u8fd0\u884c\u3002<\/p>\n<h4>5.3 \u5177\u4f53\u6848\u4f8b<\/h4>\n<h5>5.3.1 \u6848\u4f8b\u63cf\u8ff0<\/h5>\n<p>\u5047\u8bbe\u6211\u4eec\u6709\u4e00\u4e2a\u84b8\u716e\u8bbe\u5907&#xff0c;\u9700\u8981\u786e\u4fdd\u84b8\u6c7d\u538b\u529b\u57281.5 kPa\u5de6\u53f3&#xff0c;\u4ee5\u786e\u4fdd\u98df\u54c1\u5728\u9002\u5f53\u7684\u84b8\u6c7d\u538b\u529b\u4e0b\u8fdb\u884c\u84b8\u716e\u3002\u540c\u65f6&#xff0c;\u6211\u4eec\u8fd8\u9700\u8981\u68c0\u6d4b\u84b8\u6c7d\u7ba1\u9053\u4e2d\u7684\u538b\u529b&#xff0c;\u786e\u4fdd\u7ba1\u9053\u538b\u529b\u4e0d\u8d85\u8fc72.0 kPa&#xff0c;\u4ee5\u9632\u6b62\u7ba1\u9053\u635f\u574f\u548c\u5b89\u5168\u95ee\u9898\u3002<\/p>\n<h5>5.3.2 \u786c\u4ef6\u914d\u7f6e<\/h5>\n<ul>\n<li>\u538b\u529b\u4f20\u611f\u56681&#xff1a;\u578b\u53f7\u4e3aMPX5010DP&#xff08;\u7528\u4e8e\u68c0\u6d4b\u84b8\u6c7d\u538b\u529b&#xff09;<\/li>\n<li>\u538b\u529b\u4f20\u611f\u56682&#xff1a;\u578b\u53f7\u4e3aHoneywell SS510N&#xff08;\u7528\u4e8e\u68c0\u6d4b\u7ba1\u9053\u538b\u529b&#xff09;<\/li>\n<li>\u63a7\u5236\u7cfb\u7edf&#xff1a;\u57fa\u4e8eArduino\u7684\u63a7\u5236\u7cfb\u7edf<\/li>\n<li>\u84b8\u716e\u8bbe\u5907&#xff1a;\u81ea\u52a8\u63a7\u5236\u7684\u84b8\u716e\u673a<\/li>\n<\/ul>\n<h5>5.3.3 \u4ee3\u7801\u793a\u4f8b<\/h5>\n<p><span class=\"token comment\">\/\/ \u538b\u529b\u4f20\u611f\u5668\u5728\u84b8\u716e\u4e2d\u7684\u5e94\u7528\u4ee3\u7801\u793a\u4f8b<\/span><br \/>\n<span class=\"token comment\">\/\/ \u4f7f\u7528Arduino\u548c\u4e24\u4e2a\u538b\u529b\u4f20\u611f\u5668<\/span><\/p>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;Wire.h&gt;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;Adafruit_Sensor.h&gt;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;Adafruit_MPL115A2.h&gt;<\/span><\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u521b\u5efa\u538b\u529b\u4f20\u611f\u5668\u5bf9\u8c61<\/span><br \/>\nAdafruit_MPL115A2 mpl <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">Adafruit_MPL115A2<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u5b9a\u4e49\u5e38\u91cf<\/span><br \/>\n<span class=\"token keyword\">const<\/span> <span class=\"token keyword\">int<\/span> pressureSensorPin1 <span class=\"token operator\">&#061;<\/span> A0<span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u84b8\u6c7d\u538b\u529b\u4f20\u611f\u5668\u8fde\u63a5\u5230\u6a21\u62df\u8f93\u5165\u5f15\u811aA0<\/span><br \/>\n<span class=\"token keyword\">const<\/span> <span class=\"token keyword\">int<\/span> pressureSensorPin2 <span class=\"token operator\">&#061;<\/span> A1<span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u7ba1\u9053\u538b\u529b\u4f20\u611f\u5668\u8fde\u63a5\u5230\u6a21\u62df\u8f93\u5165\u5f15\u811aA1<\/span><br \/>\n<span class=\"token keyword\">const<\/span> <span class=\"token keyword\">int<\/span> targetSteamPressure <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1500<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u76ee\u6807\u84b8\u6c7d\u538b\u529b\u503c&#xff08;\u5355\u4f4d&#xff1a;\u6beb\u5df4&#xff09;<\/span><br \/>\n<span class=\"token keyword\">const<\/span> <span class=\"token keyword\">int<\/span> targetPipePressure <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">2000<\/span><span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u76ee\u6807\u7ba1\u9053\u538b\u529b\u503c&#xff08;\u5355\u4f4d&#xff1a;\u6beb\u5df4&#xff09;<\/span><br \/>\n<span class=\"token keyword\">const<\/span> <span class=\"token keyword\">int<\/span> valveControlPin1 <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">9<\/span><span class=\"token punctuation\">;<\/span>      <span class=\"token comment\">\/\/ \u63a7\u5236\u84b8\u6c7d\u9600\u95e8\u7684\u6570\u5b57\u5f15\u811a<\/span><br \/>\n<span class=\"token keyword\">const<\/span> <span class=\"token keyword\">int<\/span> valveControlPin2 <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">10<\/span><span class=\"token punctuation\">;<\/span>     <span class=\"token comment\">\/\/ \u63a7\u5236\u7ba1\u9053\u9600\u95e8\u7684\u6570\u5b57\u5f15\u811a<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u5b9a\u4e49\u53d8\u91cf<\/span><br \/>\n<span class=\"token keyword\">int<\/span> currentSteamPressure <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>       <span class=\"token comment\">\/\/ \u5f53\u524d\u68c0\u6d4b\u5230\u7684\u84b8\u6c7d\u538b\u529b\u503c<\/span><br \/>\n<span class=\"token keyword\">int<\/span> currentPipePressure <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span>        <span class=\"token comment\">\/\/ \u5f53\u524d\u68c0\u6d4b\u5230\u7684\u7ba1\u9053\u538b\u529b\u503c<\/span><br \/>\n<span class=\"token keyword\">int<\/span> valveState1 <span class=\"token operator\">&#061;<\/span> LOW<span class=\"token punctuation\">;<\/span>              <span class=\"token comment\">\/\/ \u84b8\u6c7d\u9600\u95e8\u72b6\u6001<\/span><br \/>\n<span class=\"token keyword\">int<\/span> valveState2 <span class=\"token operator\">&#061;<\/span> LOW<span class=\"token punctuation\">;<\/span>              <span class=\"token comment\">\/\/ \u7ba1\u9053\u9600\u95e8\u72b6\u6001<\/span><\/p>\n<p><span class=\"token keyword\">void<\/span> <span class=\"token function\">setup<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token comment\">\/\/ \u521d\u59cb\u5316\u4e32\u53e3\u901a\u4fe1<\/span><br \/>\n  Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">begin<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">9600<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>  <span class=\"token comment\">\/\/ \u521d\u59cb\u5316\u538b\u529b\u4f20\u611f\u5668<\/span><br \/>\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">!<\/span>mpl<span class=\"token punctuation\">.<\/span><span class=\"token function\">begin<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">println<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Failed to initialize MPL115A2 sensor!&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">while<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><\/p>\n<p>  <span class=\"token comment\">\/\/ \u8bbe\u7f6e\u9600\u95e8\u63a7\u5236\u5f15\u811a\u4e3a\u8f93\u51fa\u6a21\u5f0f<\/span><br \/>\n  <span class=\"token function\">pinMode<\/span><span class=\"token punctuation\">(<\/span>valveControlPin1<span class=\"token punctuation\">,<\/span> OUTPUT<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token function\">pinMode<\/span><span class=\"token punctuation\">(<\/span>valveControlPin2<span class=\"token punctuation\">,<\/span> OUTPUT<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token function\">digitalWrite<\/span><span class=\"token punctuation\">(<\/span>valveControlPin1<span class=\"token punctuation\">,<\/span> valveState1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token function\">digitalWrite<\/span><span class=\"token punctuation\">(<\/span>valveControlPin2<span class=\"token punctuation\">,<\/span> valveState2<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token keyword\">void<\/span> <span class=\"token function\">loop<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n  <span class=\"token comment\">\/\/ \u8bfb\u53d6\u84b8\u6c7d\u538b\u529b\u4f20\u611f\u5668\u7684\u503c<\/span><br \/>\n  mpl<span class=\"token punctuation\">.<\/span><span class=\"token function\">getPressure<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>currentSteamPressure<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Current Steam Pressure: &#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">print<\/span><span class=\"token punctuation\">(<\/span>currentSteamPressure<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">println<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034; mBar&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>  <span class=\"token comment\">\/\/ \u6839\u636e\u84b8\u6c7d\u538b\u529b\u503c\u8c03\u6574\u84b8\u6c7d\u9600\u95e8\u72b6\u6001<\/span><br \/>\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>currentSteamPressure <span class=\"token operator\">&lt;<\/span> targetSteamPressure<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    valveState1 <span class=\"token operator\">&#061;<\/span> HIGH<span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u6253\u5f00\u84b8\u6c7d\u9600\u95e8<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    valveState1 <span class=\"token operator\">&#061;<\/span> LOW<span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u5173\u95ed\u84b8\u6c7d\u9600\u95e8<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token function\">digitalWrite<\/span><span class=\"token punctuation\">(<\/span>valveControlPin1<span class=\"token punctuation\">,<\/span> valveState1<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Steam Valve State: &#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">println<\/span><span class=\"token punctuation\">(<\/span>valveState1 <span class=\"token operator\">&#061;&#061;<\/span> HIGH <span class=\"token operator\">?<\/span> <span class=\"token string\">&#034;Open&#034;<\/span> <span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;Closed&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>  <span class=\"token comment\">\/\/ \u8bfb\u53d6\u7ba1\u9053\u538b\u529b\u4f20\u611f\u5668\u7684\u503c<\/span><br \/>\n  currentPipePressure <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">analogRead<\/span><span class=\"token punctuation\">(<\/span>pressureSensorPin2<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  <span class=\"token keyword\">float<\/span> pipePressure <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">(<\/span>currentPipePressure <span class=\"token operator\">\/<\/span> <span class=\"token number\">1023.0<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">*<\/span> <span class=\"token number\">5000.0<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u5047\u8bbe\u4f20\u611f\u5668\u7684\u6700\u5927\u538b\u529b\u4e3a5000\u6beb\u5df4<\/span><br \/>\n  Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Current Pipe Pressure: &#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">print<\/span><span class=\"token punctuation\">(<\/span>pipePressure<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">println<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034; mBar&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>  <span class=\"token comment\">\/\/ \u6839\u636e\u7ba1\u9053\u538b\u529b\u503c\u8c03\u6574\u7ba1\u9053\u9600\u95e8\u72b6\u6001<\/span><br \/>\n  <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span>pipePressure <span class=\"token operator\">&lt;<\/span> targetPipePressure<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    valveState2 <span class=\"token operator\">&#061;<\/span> HIGH<span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u6253\u5f00\u7ba1\u9053\u9600\u95e8<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">else<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    valveState2 <span class=\"token operator\">&#061;<\/span> LOW<span class=\"token punctuation\">;<\/span>  <span class=\"token comment\">\/\/ \u5173\u95ed\u7ba1\u9053\u9600\u95e8<\/span><br \/>\n  <span class=\"token punctuation\">}<\/span><br \/>\n  <span class=\"token function\">digitalWrite<\/span><span class=\"token punctuation\">(<\/span>valveControlPin2<span class=\"token punctuation\">,<\/span> valveState2<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Pipe Valve State: &#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n  Serial<span class=\"token punctuation\">.<\/span><span class=\"token function\">println<\/span><span class=\"token punctuation\">(<\/span>valveState2 <span class=\"token operator\">&#061;&#061;<\/span> HIGH <span class=\"token operator\">?<\/span> <span class=\"token string\">&#034;Open&#034;<\/span> <span class=\"token operator\">:<\/span> <span class=\"token string\">&#034;Closed&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>  <span class=\"token comment\">\/\/ \u5ef6\u8fdf100\u6beb\u79d2<\/span><br \/>\n  <span class=\"token function\">delay<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">100<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<h4>5.4 \u6570\u636e\u6837\u4f8b<\/h4>\n<p>\u5047\u8bbe\u6211\u4eec\u8bb0\u5f55\u4e8610\u6b21\u84b8\u716e\u8fc7\u7a0b\u4e2d\u7684\u84b8\u6c7d\u538b\u529b\u548c\u7ba1\u9053\u538b\u529b\u6570\u636e\u5982\u4e0b&#xff1a;<\/p>\n<table>\n<tr>\u84b8\u716e\u6b21\u6570\u84b8\u6c7d\u538b\u529b (mBar)\u7ba1\u9053\u538b\u529b (mBar)<\/tr>\n<tbody>\n<tr>\n<td>1<\/td>\n<td>1490<\/td>\n<td>1980<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>1500<\/td>\n<td>2000<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>1495<\/td>\n<td>1990<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>1505<\/td>\n<td>2010<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>1500<\/td>\n<td>2000<\/td>\n<\/tr>\n<tr>\n<td>6<\/td>\n<td>1498<\/td>\n<td>1985<\/td>\n<\/tr>\n<tr>\n<td>7<\/td>\n<td>1502<\/td>\n<td>2005<\/td>\n<\/tr>\n<tr>\n<td>8<\/td>\n<td>1500<\/td>\n<td>2000<\/td>\n<\/tr>\n<tr>\n<td>9<\/td>\n<td>1495<\/td>\n<td>1995<\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>1500<\/td>\n<td>2000<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u901a\u8fc7\u8fd9\u4e9b\u6570\u636e&#xff0c;\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u6bcf\u6b21\u84b8\u716e\u8fc7\u7a0b\u4e2d\u7684\u84b8\u6c7d\u538b\u529b\u548c\u7ba1\u9053\u538b\u529b\u90fd\u5728\u76ee\u6807\u503c\u9644\u8fd1&#xff0c;\u786e\u4fdd\u4e86\u98df\u54c1\u5728\u9002\u5f53\u7684\u84b8\u6c7d\u538b\u529b\u4e0b\u8fdb\u884c\u84b8\u716e&#xff0c;\u5e76\u4e14\u7ba1\u9053\u538b\u529b\u4fdd\u6301\u5728\u5b89\u5168\u8303\u56f4\u5185&#xff0c;\u9632\u6b62\u4e86\u7ba1\u9053\u635f\u574f\u548c\u5b89\u5168\u95ee\u9898\u3002<\/p>\n<h3>6. \u603b\u7ed3<\/h3>\n<p>\u901a\u8fc7\u4e0a\u8ff0\u6848\u4f8b\u5206\u6790&#xff0c;\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u538b\u529b\u4f20\u611f\u5668\u5728\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u591a\u79cd\u5e94\u7528&#xff0c;\u5305\u62ec\u996e\u6599\u704c\u88c5\u3001\u8089\u7c7b\u52a0\u5de5\u3001\u70d8\u7119\u548c\u84b8\u716e\u7b49\u73af\u8282\u3002\u8fd9\u4e9b\u5e94\u7528\u4e0d\u4ec5\u63d0\u9ad8\u4e86\u751f\u4ea7\u6548\u7387\u548c\u8d28\u91cf&#xff0c;\u8fd8\u786e\u4fdd\u4e86\u8bbe\u5907\u7684\u7a33\u5b9a\u8fd0\u884c\u548c\u5b89\u5168\u6027\u3002\u901a\u8fc7\u5408\u7406\u914d\u7f6e\u548c\u4f7f\u7528\u538b\u529b\u4f20\u611f\u5668&#xff0c;\u98df\u54c1\u52a0\u5de5\u4f01\u4e1a\u53ef\u4ee5\u66f4\u597d\u5730\u63a7\u5236\u751f\u4ea7\u8fc7\u7a0b&#xff0c;\u63d0\u9ad8\u4ea7\u54c1\u7684\u4e00\u81f4\u6027\u548c\u53ef\u9760\u6027\u3002\u5e0c\u671b\u8fd9\u4e9b\u6848\u4f8b\u548c\u4ee3\u7801\u793a\u4f8b\u80fd\u591f\u4e3a\u98df\u54c1\u52a0\u5de5\u884c\u4e1a\u7684\u5de5\u7a0b\u5e08\u548c\u6280\u672f\u4eba\u5458\u63d0\u4f9b\u53c2\u8003\u548c\u5e2e\u52a9\u3002<\/p>\n<h3>7. \u5c55\u671b<\/h3>\n<p>\u968f\u7740\u4f20\u611f\u5668\u6280\u672f\u7684\u4e0d\u65ad\u8fdb\u6b65\u548c\u667a\u80fd\u5316\u7684\u666e\u53ca&#xff0c;\u672a\u6765\u538b\u529b\u4f20\u611f\u5668\u5728\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u5e94\u7528\u5c06\u66f4\u52a0\u5e7f\u6cdb\u548c\u6df1\u5165\u3002\u4f8b\u5982&#xff0c;\u7ed3\u5408\u7269\u8054\u7f51\u6280\u672f&#xff0c;\u53ef\u4ee5\u5b9e\u73b0\u8fdc\u7a0b\u76d1\u63a7\u548c\u6570\u636e\u91c7\u96c6&#xff0c;\u8fdb\u4e00\u6b65\u63d0\u9ad8\u751f\u4ea7\u8fc7\u7a0b\u7684\u900f\u660e\u5ea6\u548c\u53ef\u63a7\u6027\u3002\u6b64\u5916&#xff0c;\u901a\u8fc7\u6570\u636e\u5206\u6790\u548c\u673a\u5668\u5b66\u4e60&#xff0c;\u53ef\u4ee5\u9884\u6d4b\u8bbe\u5907\u6545\u969c\u548c\u4f18\u5316\u751f\u4ea7\u53c2\u6570&#xff0c;\u5b9e\u73b0\u66f4\u52a0\u667a\u80fd\u5316\u7684\u751f\u4ea7\u7ba1\u7406\u3002\u5e0c\u671b\u98df\u54c1\u52a0\u5de5\u884c\u4e1a\u80fd\u591f\u7ee7\u7eed\u63a2\u7d22\u548c\u5e94\u7528\u8fd9\u4e9b\u5148\u8fdb\u6280\u672f&#xff0c;\u63a8\u52a8\u884c\u4e1a\u7684\u6301\u7eed\u53d1\u5c55\u548c\u521b\u65b0\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814224931-689e67fbb310c.jpg\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb555\u6b21\uff0c\u70b9\u8d5e21\u6b21\uff0c\u6536\u85cf20\u6b21\u3002\u901a\u8fc7\u4e0a\u8ff0\u6848\u4f8b\u5206\u6790\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u538b\u529b\u4f20\u611f\u5668\u5728\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u591a\u79cd\u5e94\u7528\uff0c\u5305\u62ec\u996e\u6599\u704c\u88c5\u3001\u8089\u7c7b\u52a0\u5de5\u3001\u70d8\u7119\u548c\u84b8\u716e\u7b49\u73af\u8282\u3002\u8fd9\u4e9b\u5e94\u7528\u4e0d\u4ec5\u63d0\u9ad8\u4e86\u751f\u4ea7\u6548\u7387\u548c\u8d28\u91cf\uff0c\u8fd8\u786e\u4fdd\u4e86\u8bbe\u5907\u7684\u7a33\u5b9a\u8fd0\u884c\u548c\u5b89\u5168\u6027\u3002\u901a\u8fc7\u5408\u7406\u914d\u7f6e\u548c\u4f7f\u7528\u538b\u529b\u4f20\u611f\u5668\uff0c\u98df\u54c1\u52a0\u5de5\u4f01\u4e1a\u53ef\u4ee5\u66f4\u597d\u5730\u63a7\u5236\u751f\u4ea7\u8fc7\u7a0b\uff0c\u63d0\u9ad8\u4ea7\u54c1\u7684\u4e00\u81f4\u6027\u548c\u53ef\u9760\u6027\u3002\u5e0c\u671b\u8fd9\u4e9b\u6848\u4f8b\u548c\u4ee3\u7801\u793a\u4f8b\u80fd\u591f\u4e3a\u98df\u54c1\u52a0\u5de5\u884c\u4e1a\u7684\u5de5\u7a0b\u5e08\u548c\u6280\u672f\u4eba\u5458\u63d0\u4f9b\u53c2\u8003\u548c\u5e2e\u52a9\u3002<\/p>\n","protected":false},"author":2,"featured_media":56996,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[50,5138,2710,395,44],"topic":[],"class_list":["post-56997","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-50","tag-5138","tag-2710","tag-395","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4f20\u611f\u5668\u5e94\u7528\u6848\u4f8b\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u5de5\u4e1a\u81ea\u52a8\u5316\u4e2d\u7684\u5e94\u7528_\uff0819\uff09.\u6848\u4f8b\u5206\u6790\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u5e94\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/56997.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f20\u611f\u5668\u5e94\u7528\u6848\u4f8b\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u5de5\u4e1a\u81ea\u52a8\u5316\u4e2d\u7684\u5e94\u7528_\uff0819\uff09.\u6848\u4f8b\u5206\u6790\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u5e94\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb555\u6b21\uff0c\u70b9\u8d5e21\u6b21\uff0c\u6536\u85cf20\u6b21\u3002\u901a\u8fc7\u4e0a\u8ff0\u6848\u4f8b\u5206\u6790\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u538b\u529b\u4f20\u611f\u5668\u5728\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u591a\u79cd\u5e94\u7528\uff0c\u5305\u62ec\u996e\u6599\u704c\u88c5\u3001\u8089\u7c7b\u52a0\u5de5\u3001\u70d8\u7119\u548c\u84b8\u716e\u7b49\u73af\u8282\u3002\u8fd9\u4e9b\u5e94\u7528\u4e0d\u4ec5\u63d0\u9ad8\u4e86\u751f\u4ea7\u6548\u7387\u548c\u8d28\u91cf\uff0c\u8fd8\u786e\u4fdd\u4e86\u8bbe\u5907\u7684\u7a33\u5b9a\u8fd0\u884c\u548c\u5b89\u5168\u6027\u3002\u901a\u8fc7\u5408\u7406\u914d\u7f6e\u548c\u4f7f\u7528\u538b\u529b\u4f20\u611f\u5668\uff0c\u98df\u54c1\u52a0\u5de5\u4f01\u4e1a\u53ef\u4ee5\u66f4\u597d\u5730\u63a7\u5236\u751f\u4ea7\u8fc7\u7a0b\uff0c\u63d0\u9ad8\u4ea7\u54c1\u7684\u4e00\u81f4\u6027\u548c\u53ef\u9760\u6027\u3002\u5e0c\u671b\u8fd9\u4e9b\u6848\u4f8b\u548c\u4ee3\u7801\u793a\u4f8b\u80fd\u591f\u4e3a\u98df\u54c1\u52a0\u5de5\u884c\u4e1a\u7684\u5de5\u7a0b\u5e08\u548c\u6280\u672f\u4eba\u5458\u63d0\u4f9b\u53c2\u8003\u548c\u5e2e\u52a9\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/56997.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-14T22:49:32+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814224931-689e67fbb310c.jpg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/56997.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/56997.html\",\"name\":\"\u4f20\u611f\u5668\u5e94\u7528\u6848\u4f8b\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u5de5\u4e1a\u81ea\u52a8\u5316\u4e2d\u7684\u5e94\u7528_\uff0819\uff09.\u6848\u4f8b\u5206\u6790\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u5e94\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-14T22:49:32+00:00\",\"dateModified\":\"2025-08-14T22:49:32+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/56997.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/56997.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/56997.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f20\u611f\u5668\u5e94\u7528\u6848\u4f8b\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u5de5\u4e1a\u81ea\u52a8\u5316\u4e2d\u7684\u5e94\u7528_\uff0819\uff09.\u6848\u4f8b\u5206\u6790\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u5e94\u7528\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u4f20\u611f\u5668\u5e94\u7528\u6848\u4f8b\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u5de5\u4e1a\u81ea\u52a8\u5316\u4e2d\u7684\u5e94\u7528_\uff0819\uff09.\u6848\u4f8b\u5206\u6790\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u5e94\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/56997.html","og_locale":"zh_CN","og_type":"article","og_title":"\u4f20\u611f\u5668\u5e94\u7528\u6848\u4f8b\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u5de5\u4e1a\u81ea\u52a8\u5316\u4e2d\u7684\u5e94\u7528_\uff0819\uff09.\u6848\u4f8b\u5206\u6790\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u5e94\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb555\u6b21\uff0c\u70b9\u8d5e21\u6b21\uff0c\u6536\u85cf20\u6b21\u3002\u901a\u8fc7\u4e0a\u8ff0\u6848\u4f8b\u5206\u6790\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u538b\u529b\u4f20\u611f\u5668\u5728\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u591a\u79cd\u5e94\u7528\uff0c\u5305\u62ec\u996e\u6599\u704c\u88c5\u3001\u8089\u7c7b\u52a0\u5de5\u3001\u70d8\u7119\u548c\u84b8\u716e\u7b49\u73af\u8282\u3002\u8fd9\u4e9b\u5e94\u7528\u4e0d\u4ec5\u63d0\u9ad8\u4e86\u751f\u4ea7\u6548\u7387\u548c\u8d28\u91cf\uff0c\u8fd8\u786e\u4fdd\u4e86\u8bbe\u5907\u7684\u7a33\u5b9a\u8fd0\u884c\u548c\u5b89\u5168\u6027\u3002\u901a\u8fc7\u5408\u7406\u914d\u7f6e\u548c\u4f7f\u7528\u538b\u529b\u4f20\u611f\u5668\uff0c\u98df\u54c1\u52a0\u5de5\u4f01\u4e1a\u53ef\u4ee5\u66f4\u597d\u5730\u63a7\u5236\u751f\u4ea7\u8fc7\u7a0b\uff0c\u63d0\u9ad8\u4ea7\u54c1\u7684\u4e00\u81f4\u6027\u548c\u53ef\u9760\u6027\u3002\u5e0c\u671b\u8fd9\u4e9b\u6848\u4f8b\u548c\u4ee3\u7801\u793a\u4f8b\u80fd\u591f\u4e3a\u98df\u54c1\u52a0\u5de5\u884c\u4e1a\u7684\u5de5\u7a0b\u5e08\u548c\u6280\u672f\u4eba\u5458\u63d0\u4f9b\u53c2\u8003\u548c\u5e2e\u52a9\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/56997.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-14T22:49:32+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250814224931-689e67fbb310c.jpg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/56997.html","url":"https:\/\/www.wsisp.com\/helps\/56997.html","name":"\u4f20\u611f\u5668\u5e94\u7528\u6848\u4f8b\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u5de5\u4e1a\u81ea\u52a8\u5316\u4e2d\u7684\u5e94\u7528_\uff0819\uff09.\u6848\u4f8b\u5206\u6790\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u5e94\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-14T22:49:32+00:00","dateModified":"2025-08-14T22:49:32+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/56997.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/56997.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/56997.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u4f20\u611f\u5668\u5e94\u7528\u6848\u4f8b\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u5de5\u4e1a\u81ea\u52a8\u5316\u4e2d\u7684\u5e94\u7528_\uff0819\uff09.\u6848\u4f8b\u5206\u6790\uff1a\u538b\u529b\u4f20\u611f\u5668\u5728\u98df\u54c1\u52a0\u5de5\u4e2d\u7684\u5e94\u7528"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/56997","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=56997"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/56997\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/56996"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=56997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=56997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=56997"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=56997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}