{"id":21298,"date":"2022-10-27T00:00:29","date_gmt":"2022-10-26T16:00:29","guid":{"rendered":"https:\/\/techclass.wfjydl.com\/?p=21298"},"modified":"2026-04-27T09:50:52","modified_gmt":"2026-04-27T01:50:52","slug":"%e4%b8%80%e6%ac%be%e7%94%a8raspberry-pi%e5%92%8c%e4%bc%a0%e6%84%9f%e5%99%a8%e5%88%b6%e4%bd%9c%e7%9a%84%e5%8f%af%e7%a9%bf%e6%88%b4%e5%bc%8f%e5%b0%8f%e5%9e%8b%e5%81%a5%e5%ba%b7%e7%ae%a1%e7%90%86-2","status":"publish","type":"post","link":"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/raspberry\/raspberrypi-wearable-healthcare-device-02\/","title":{"rendered":"\u4e00\u6b3e\u7528Raspberry Pi\u548c\u4f20\u611f\u5668\u5236\u4f5c\u7684\u53ef\u7a7f\u6234\u5f0f\u5c0f\u578b\u5065\u5eb7\u7ba1\u7406\u8bbe\u5907\uff01\u7b2c\u4e8c\u90e8\u5206"},"content":{"rendered":"<p>\u7b2c1\u90e8\u5206\uff1a<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/raspberry\/raspberrypi-wearable-healthcare-device-01\/\">\u7528Raspberry Pi Zero\u548c\u7f57\u59c6SensorMedal\u5236\u4f5c\u5065\u5eb7\u7ba1\u7406\u8bbe\u5907\uff01<\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>\u6839\u636e\u4f20\u611f\u5668\u7684\u503c\u8ba1\u7b97\u6b65\u6570\u3001\u8ddd\u79bb\u548c\u5361\u8def\u91cc\uff0c\u5e76\u5c06\u6570\u636e\u53d1\u9001\u5230LINE\uff01<\/h2>\n<p>\u5927\u5bb6\u597d\uff0c\u6211\u662f\u5409\u7530\uff01<\/p>\n<p>\u4ece\u8fd9\u90e8\u5206\u5f00\u59cb\uff0c\u6211\u4eec\u5c06\u7740\u624b\u5236\u4f5c\u8fd9\u6b3e\u7528\u6765\u89e3\u51b3\u8fd0\u52a8\u4e0d\u8db3\u95ee\u9898\u7684\u5065\u5eb7\u7ba1\u7406\u8bbe\u5907\u3002\u9996\u5148\uff0c\u6211\u4eec\u4f7f\u7528\u7f57\u59c6SensorMedal\u6765\u6d4b\u91cf\u548c\u8ba1\u7b97\u6b65\u6570\u3001\u79fb\u52a8\u8ddd\u79bb\u3001\u6d88\u8017\u7684\u5361\u8def\u91cc\u7b49\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u5c06\u60a8\u5728\u5bb6\u4e2d\u6563\u6b65\u7684\u7ed3\u679c\u53d1\u9001\u5230LINE\uff0c\u662f\u4e0d\u662f\u53ef\u4ee5\u63d0\u9ad8\u60a8\u7684\u8fd0\u52a8\u79ef\u6781\u6027\u5462\uff1f\u60a8\u53ef\u80fd\u4f1a\u610f\u5916\u5730\u53d1\u73b0\uff0c\u81ea\u5df1\u5728\u5bb6\u91cc\u7adf\u7136\u8fd0\u52a8\u91cf\u4e5f\u4e0d\u5c0f\uff0c\u5982\u679c\u7528\u5f97\u597d\uff0c\u4e5f\u8bb8\u8fd8\u53ef\u4ee5\u51cf\u80a5\u54e6\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26641\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-wearable-healthcare-device-02_01.jpg\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-wearable-healthcare-device-02_01.jpg 600w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-wearable-healthcare-device-02_01.jpg 300w\" alt=\"raspberrypi-wearable-healthcare-device-02_01\" width=\"600\" height=\"431\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>\u672c\u90e8\u5206\u6240\u9700\u90e8\u4ef6<\/h2>\n<h3><a href=\"https:\/\/amzn.to\/3eJYkFl\" target=\"_blank\" rel=\"noopener\">Raspberry Pi Zero WH<\/a><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26642\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-wearable-healthcare-device-02_02.jpg\" sizes=\"auto, (max-width: 468px) 100vw, 468px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-wearable-healthcare-device-02_02.jpg 468w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-wearable-healthcare-device-02_02.jpg 300w\" alt=\"raspberrypi-wearable-healthcare-device-02_02\" width=\"468\" height=\"297\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><a href=\"https:\/\/jp.rs-online.com\/web\/p\/sensor-development-kits\/1812214?sra=pmpn\" target=\"_blank\" rel=\"noopener\">\u7f57\u59c6SensorMedal<\/a>(SensorMedal-EVK-002)<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26531\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-comfortable-space-device-03-4.jpg\" sizes=\"auto, (max-width: 416px) 100vw, 416px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-comfortable-space-device-03-4.jpg 416w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-comfortable-space-device-03-4.jpg 300w\" alt=\"raspberrypi-comfortable-space-device-03-4\" width=\"416\" height=\"298\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>\u672c\u90e8\u5206\u7684\u6d41\u7a0b<\/h2>\n<ol>\n<li>\u8ba1\u7b97\u79fb\u52a8\u8ddd\u79bb\u548c\u5361\u8def\u91cc\u6d88\u8017\u91cf<\/li>\n<li>\u5c06\u6b65\u6570\u901a\u77e5LINE<\/li>\n<li>\u603b\u7ed3<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2>1. \u8ba1\u7b97\u79fb\u52a8\u8ddd\u79bb\u548c\u5361\u8def\u91cc\u6d88\u8017\u91cf<\/h2>\n<p>\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f7f\u7528\u7f57\u59c6\u7684<a href=\"https:\/\/www.rohm.co.jp\/sensor-medal-support\" target=\"_blank\" rel=\"noopener\">SensorMedal(SensorMedal-EVK-002)<\/a>\u6765\u6d4b\u91cf\u6b65\u6570\u548c\u8ddd\u79bb\u3002\u5728<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/raspberry\/raspberrypi-wearable-healthcare-device-01\/\">\u7b2c\u4e00\u90e8\u5206<\/a>\u4e2d\uff0c\u6211\u4eec\u5728Raspberry Pi Zero\u4e0a\u5b89\u88c5\u4e86\u4e00\u4e2a\u540d\u4e3a\u201c<a href=\"https:\/\/deviceplus.jp\/hobby\/raspberrypi-comfortable-space-device-02\/\">bluepy<\/a>\u201d\u7684\u5e93\uff0c\u4ee5\u4fbf\u80fd\u591f\u901a\u8fc7Bluetooth\u5c06SensorMedal\u8fde\u63a5\u5230Raspberry Pi\u3002\u53e6\u5916\uff0c\u6211\u4eec\u8fd8\u901a\u8fc7\u4f7f\u7528<a href=\"http:\/\/github.com\/bokunimowakaru\/SensorMedal2\" target=\"_blank\" rel=\"noopener\">Github<\/a>\u4e2d\u7684\u4fbf\u6377\u7a0b\u5e8f\uff0c\u83b7\u5f97\u4e86\u4ee5\u4e0b\u6570\u636e\u3002<\/p>\n<pre class=\"brush: cpp; title: Code-Example; notranslate\" title=\"Code-Example\">pi@raspizero:~\/SensorMedal2 $ sudo python3 ble_logger_SensorMedal2.py\r\n...\r\nDevice c5:xx:yy:zz::d0 (random), RSSI=-65 dB\r\n  Short Local Name = 极悦娱乐Medal2_0107_01.00\r\n  Flags = 06\r\n  Incomplete 16b Services = 0000180a-0000\r\n  Manufacturer = 0100c86abcdef\r\n    ID            = 0x1\r\n    SEQ           = 188\r\n    Temperature   = 27.99 \u2103\r\n    Humidity      = 71.52 %\r\n    Pressure      = 998.578 hPa\r\n    Illuminance   = 93.3 lx\r\n    Accelerometer = 1.453 g ( 0.062 0.844 1.181 g)\r\n    Geomagnetic   = 92.6 uT ( -15.8 -58.0 -70.4 uT)\r\n    Magnetic      = 0x3\r\n    Steps         = 8 \u6b69\r\n    Battery Level = 90 %\r\n    RSSI          = -65 dB\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>\u53ef\u4eceSensorMedal\u83b7\u53d6\u7684\u6d4b\u91cf\u503c\uff1a<\/strong><\/p>\n<ul>\n<li>Temperature: \u6e29\u5ea6\uff08\u2103\uff09<\/li>\n<li>Humidity: \u6e7f\u5ea6\uff08%\uff09<\/li>\n<li>Pressure: \u6c14\u538b\uff08hPa\uff09<\/li>\n<li>Illuminance: \u4eae\u5ea6\uff08lx\uff09<\/li>\n<li>Accelerometer: \u52a0\u901f\u5ea6\uff08x\u8f74\u3001y\u8f74\u3001z\u8f74\uff09\uff08g\uff09<\/li>\n<li>Geomagnetic: \u9640\u87ba\u4eea\u4f20\u611f\u5668\u503c\uff08x\u8f74\u3001y\u8f74\u3001z\u8f74\uff09\uff08uT\uff09<\/li>\n<li>Magnetic: \u970d\u5c14\u4f20\u611f\u5668\u503c\uff08\u78c1\u94c1\u5728\u9644\u8fd1\u901a\u8fc7\u4e3a1\uff0c\u5426\u5219\u4e3a0\uff09<\/li>\n<li>Steps: \u6b65\u6570\uff08\u6b65\uff09<\/li>\n<li>Battery Level: \u7535\u6c60\u7535\u91cf<\/li>\n<\/ul>\n<p>\u5176\u4e2d\uff0cSteps\u7528\u6765\u83b7\u53d6\u52a0\u901f\u5ea6\u4f20\u611f\u5668\u7684\u6b65\u6570\u6570\u636e\u3002\u9996\u5148\uff0c\u6211\u60f3\u6839\u636e\u8be5\u6b65\u6570\u6570\u636e\u8ba1\u7b97\u79fb\u52a8\u8ddd\u79bb\u3002\u4e3a\u6b64\uff0c\u9700\u8981\u6bcf\u6b65\u7684\u8ddd\u79bb\uff08\u6b65\u5e45\uff09\uff0c\u8fd9\u4e2a\u6570\u636e\u56e0\u4eba\u800c\u5f02\uff0c\u53ef\u4ee5\u6839\u636e\u8eab\u9ad8\uff0c\u6309\u7167\u201c\u8eab\u9ad8\/2\u301c\u8eab\u9ad8\u00d71.2\u201d\u8ba1\u7b97\u3002\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u7b80\u5355\u5730\u8bbe\u6bcf\u6b65\u7684\u6b65\u5e45 = 0.5m\u3002<\/p>\n<p>\u6211\u4eec\u5148\u6765\u8ba1\u7b97\u4e00\u4e0b\u60a8\u5728\u5bb6\u4e2d\u79fb\u52a8\uff08\u6b65\u884c\uff09\u6240\u6d88\u8017\u7684\u5361\u8def\u91cc\u5427\u3002\u6709\u8fd9\u6837\u4e00\u4e2a\u6d4b\u91cf\u503c\uff1a\u4e00\u4e2a\u5065\u5eb7\u7537\u60271\u5929\u8d7010000\u6b65\u5de6\u53f3\u6d88\u8017\u7684\u5361\u8def\u91cc\u7ea6\u4e3a350kcal\uff08\u7ea6\u4e00\u7897\u7c73\u996d\uff09\u3002\u53c2\u8003\u8fd9\u4e2a\u503c\uff0c\u6211\u4eec\u4f7f\u7528350\/10,000 = 0.035\u4f5c\u4e3a\u6bcf\u6b65\u7684\u7cfb\u6570\u3002<\/p>\n<p>\u7efc\u4e0a\u6240\u8ff0\uff0c\u6211\u4eec\u9700\u8981\u8ba1\u7b97\u7684\u9879\u76ee\u6c47\u603b\u5982\u4e0b\uff1a<\/p>\n<table>\n<tbody>\n<tr bgcolor=\"#e0ffff\">\n<td>\u7f16\u53f7<\/td>\n<td>\u8f93\u51fa\u503c<\/td>\n<td>\u8ba1\u7b97\u65b9\u6cd5<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>Steps \u6b65\u6570 (\u6b65)<\/td>\n<td>\u4ece\u52a0\u901f\u5ea6\u4f20\u611f\u5668\u83b7\u53d6\u6b65\u6570<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>Distance \u79fb\u52a8\u8ddd\u79bb\uff08m\uff09<\/td>\n<td>\u6b65\u6570\u00d7\u6bcf\u6b65\u8ddd\u79bb\uff08\u8fd9\u91cc\u7b80\u5355\u5730\u5047\u8bbe\u4e3a\u6bcf\u6b650.5m\uff09<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>Calorie \u5361\u8def\u91cc\uff08kcal\uff09<\/td>\n<td>\u6b65\u6570 \u00d7 \u6bcf\u6b65\u6d88\u8017\u7684\u5361\u8def\u91cc\u91cf\uff08\u8fd9\u91cc\u4f7f\u7528\u5361\u8def\u91cc\u7cfb\u65700.035\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u4e0b\u9762\uff0c\u6211\u4eec\u5c06\u5176\u5199\u6210\u4e00\u4e2a\u7a0b\u5e8f\uff1a<\/p>\n<pre class=\"brush: cpp; title: Code-Example; notranslate\" title=\"Code-Example\">pi@raspizero:~\/SensorMedal2 $ sudo cp ble_logger_SensorMedal2.py ~\/Programs\/ble_steps.py\r\npi@raspizero:~\/ $ sudo vi ~\/Programs\/ble_steps.py\r\n\r\n\uff08\u5143\u306eble_logger_SensorMedal2.py\u30d7\u30ed\u30b0\u30e9\u30e0\u306b9\u301c29\u884c\u76ee\u306e\u90e8\u5206\u3092\u8ffd\u8a18\u3057\u3066\u3044\u307e\u3059\uff09\r\n---\r\n                sensors['Magnetic'] = hex(payval(27))\r\n                sensors['Steps'] = payval(28,2)\r\n\r\n                step_cnt = sensors['Steps']\r\n                if SEQ in [0,1] and step_cnt == 0:\r\n                    start_seq+= 1\r\n                    start_time= datetime.now()\r\n                    print(start_time.strftime('%H:%M:%S')+\"\u306b\u30b9\u30bf\u30fc\u30c8!\")\r\n                else:\r\n                    last_time= start_time\r\n                    last_cnt = step_cnt\r\n\r\n                cur_time= datetime.now()\r\n                time_text= cur_time.strftime('%Y\/%m\/%d(%a) %H:%M:%S')\r\n                print(time_text)\r\n                if start_seq &gt;= 1:\r\n                    dur_time= cur_time - start_time\r\n                    cur_cnt = step_cnt\r\n                    cur_mv = round(cur_cnt*0.5,1)\r\n                    cur_cal = round(cur_cnt*0.035,1)\r\n                    dur_seconds = dur_time.seconds\r\n                    dur_seconds = 1 if dur_seconds==0 else dur_seconds\r\n                    step_text= str(dur_seconds)+\"s \"+str(cur_cnt)+\"Steps \"+str(cur_mv)+\"m \"+str(cur_cal)+\"Cal\"\r\n                    print(step_text)\r\n\r\n                sensors['Battery Level'] = payval(30)\r\n                sensors['RSSI'] = dev.rssi\r\n---\r\n<\/pre>\n<p>\u8fd0\u884c\u8fd9\u4e2a\u7a0b\u5e8fble_steps.py\u3002\u542f\u52a8\u8be5\u7a0b\u5e8f\u540e\uff0c\u6309\u4e0bSensorMedal\u7684\u6309\u94ae\uff0c\u5c06\u5176\u91cd\u7f6e\u4e00\u6b21\uff0c\u7136\u540e\u5c06\u4ece\u90a3\u91cc\u5f00\u59cb\u8ba1\u7b97\u6b65\u6570\u548c\u65f6\u95f4\u3002<\/p>\n<pre class=\"brush: cpp; title: Code-Example; notranslate\" title=\"Code-Example\">pi@raspizero:~\/Programs $ sudo python3 ble_steps.py\r\n<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2022\/10\/raspberrypi-wearable-healthcare-device-02_03-e1595864647694.jpg\" alt=\"raspberrypi-wearable-healthcare-device-02_03-e1595864647694\" width=\"450\" height=\"441\" class=\"alignnone size-full wp-image-21345\" \/><\/p>\n<p>\u53ef\u4ee5\u770b\u5230\uff0c\u6210\u529f\u663e\u793a\u4e86\u6839\u636e\u6b65\u6570\u8ba1\u7b97\u51fa\u6765\u7684\u79fb\u52a8\u8ddd\u79bb\u548c\u5361\u8def\u91cc\u7b49\u6570\u636e\uff0c\u56e0\u6b64\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06SensorMedal\u653e\u5728\u8863\u515c\u7b49\u4f4d\u7f6e\uff0c\u5c06Raspberry Pi Zero\u8fde\u63a5\u7535\u6e90\u5e76\u653e\u5728\u623f\u95f4\u4e2d\u3002\u73b0\u5728\uff0c\u60a8\u53ef\u4ee5\u50cf\u4f7f\u7528\u8ba1\u6b65\u5668\u4e00\u6837\u4f7f\u7528SensorMedal\u4e86\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26648\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-wearable-healthcare-device-02_08.jpg\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-wearable-healthcare-device-02_08.jpg 600w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-wearable-healthcare-device-02_08.jpg 300w\" alt=\"raspberrypi-wearable-healthcare-device-02_08\" width=\"600\" height=\"431\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>2. \u5c06\u6b65\u6570\u901a\u77e5LINE<\/h2>\n<p>\u63a5\u4e0b\u6765\uff0c\u5f53\u8fbe\u5230\u4e00\u5b9a\u6570\u5b57\u7684\u6b65\u6570\u65f6\uff0c\u53ef\u4ee5\u5c06\u6570\u636e\u53d1\u9001\u5230LINE\u4ee5\u4fbf\u4e8e\u67e5\u770b\u3002\u4f8b\u5982\uff0c\u6bcf\u5f53\u60a8\u8d70\u4e86\u3007\u3007\u6b65\u65f6\uff0c\u6216\u8005\u6bcf\u5f53\u60a8\u8d70\u8def\u65f6\uff0c\u5c06\u201c\u60a8\u5df2\u7ecf\u8d70\u4e86\u3007\u3007\u6b65\uff01\u201d\u7b49\u6570\u636e\u53d1\u9001\u5230LINE\u7b49\u5de5\u5177\uff0c\u4e5f\u8bb8\u53ef\u4ee5\u63d0\u9ad8\u60a8\u8fd0\u52a8\u7684\u79ef\u6781\u6027\u3002<\/p>\n<p>\u9996\u5148\uff0c\u8981\u4f7f\u7528LINE\uff0c\u9700\u8981\u5148\u4ece\u201c<a href=\"https:\/\/notify-bot.line.me\/ja\/\" target=\"_blank\" rel=\"noopener\">LINE Notify<\/a>\u201d\u9875\u9762\u4e0a\u767b\u5f55\u3002<\/p>\n<p><a href=\"https:\/\/notify-bot.line.me\/ja\/\" target=\"_blank\" rel=\"noopener\">https:\/\/notify-bot.line.me\/ja\/<\/a><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2022\/10\/raspberrypi-wearable-healthcare-device-02_04.jpg\" alt=\"raspberrypi-wearable-healthcare-device-02_04\" width=\"615\" height=\"429\" class=\"alignnone size-full wp-image-21336\" \/><\/p>\n<p>\u4ece\u53f3\u4e0a\u89d2\u7684\u767b\u5f55\u533a\u57df\u4f7f\u7528\u60a8\u7684LINE Developer\u5e10\u6237\u767b\u5f55\uff08\u5982\u679c\u60a8\u6ca1\u6709\u8d26\u6237\uff0c\u8bf7\u5148\u6ce8\u518c\uff09\u3002\u767b\u5f55\u540e\uff0c\u9700\u8981\u53d1\u884c\u8bbf\u95ee\u4ee4\u724c\uff0c\u4ee5\u4fbf\u80fd\u591f\u4ece\u201c\u6211\u7684\u201d\u9875\u9762\u5411LINE\u53d1\u9001\u6d88\u606f\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2022\/10\/raspberrypi-wearable-healthcare-device-02_05.jpg\" alt=\"raspberrypi-wearable-healthcare-device-02_05\" width=\"397\" height=\"223\" class=\"alignnone size-full wp-image-21338\" \/><\/p>\n<p>\u5728\u8fd9\u91cc\u9700\u8981\u53d6\u4e00\u4e2a\u5408\u9002\u7684\u4ee4\u724c\u540d\u79f0\uff0c\u5e76\u5728LINE\u4e2d\u9009\u62e9\u4e00\u4e2a\u804a\u5929\u5ba4\uff0c\u7136\u540e\u53d1\u884c\u4ee4\u724c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26646\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-wearable-healthcare-device-02_06.png\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-wearable-healthcare-device-02_06.png 600w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-wearable-healthcare-device-02_06.png 300w\" alt=\"raspberrypi-wearable-healthcare-device-02_06\" width=\"600\" height=\"250\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>\u8fd9\u65f6\uff0c\u5c06\u4f1a\u663e\u793a\u7528\u6765\u53d1\u9001LINE Notify\u7684\u4ee4\u724c\uff0c\u590d\u5236\u8be5\u4ee4\u724c\u3002\u5982\u679c\u5173\u95ed\u8be5\u9875\u9762\u5c06\u9700\u8981\u91cd\u65b0\u53d1\u884c\u4ee4\u724c\uff0c\u56e0\u6b64\u8bf7\u52a1\u5fc5\u786e\u4fdd\u5df2\u7ecf\u590d\u5236\u597d\u4e86\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2022\/10\/raspberrypi-wearable-healthcare-device-02_07.jpg\" alt=\"raspberrypi-wearable-healthcare-device-02_07\" width=\"607\" height=\"405\" class=\"alignnone size-full wp-image-21339\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>\u4f7f\u7528\u8be5\u4ee4\u724c\u5728Raspberry Pi\u4e0a\u6dfb\u52a0\u7a0b\u5e8f\u3002\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u5c06\u7a0b\u5e8f\u6dfb\u52a0\u5230\u524d\u9762\u63d0\u5230\u7684\u201cble_steps.py\u201d\u4e2d\uff0c\u4f7f\u5176\u6210\u4e3a\u201cble_steps_line.py\u201d\u3002\u5c06\u590d\u5236\u7684\u4ee4\u724c\u7c98\u8d34\u5230\u4e0b\u9762\u4ee3\u7801\u7684\u7b2c11\u884c\uff0c\u5373\u201cxxx\u201d\u7684\u4f4d\u7f6e\u3002<\/p>\n<pre class=\"brush: cpp; title: Code-Example; notranslate\" title=\"Code-Example\">pi@raspizero:~\/Programs $ sudo cp ble_steps.py ble_steps_line.py\r\npi@raspizero:~\/Programs $ sudo vi ble_steps_line.py\r\n\r\n\uff08\u5728\u539f\u6765\u7684ble_steps.py\u7a0b\u5e8f\u4e2d\u589e\u52a0\u7b2c8\u301c17\u884c\u3001\u7b2c24\u301c27\u884c\u7684\u5185\u5bb9\uff09\r\n---\r\nscanner = btle.Scanner()\r\n\r\nimport requests\r\ndef line_message(text):\r\n    url    = \"https:\/\/notify-api.line.me\/api\/notify\"\r\n    token  = \"xxx\"\r\n    headers= {\"Authorization\":\"Bearer \"+token,\r\n            \"Content-Type\":\"application\/x-www-form-urlencoded\"}\r\n    payload = {\"message\":text,\r\n            \"stickerPackageId\":2,\r\n            \"stickerId\":513}\r\n    r = requests.post(url ,headers = headers ,params=payload)\r\n\r\nwhile True:\r\n\r\n---\r\n                    print(step_text)\r\n\r\n                    if cur_cnt &gt; 10:\r\n                        comp_text = str(cur_cnt)+\"\u6b69\u3042\u308b\u3044\u305f\u3088\uff01\"\r\n                        if cur_cnt%20 == 0:\r\n                            line_message(comp_text)\r\n\r\n                sensors['Battery Level'] = payval(30)\r\n---\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u8fd9\u6b21\u6211\u4e3a\u4e86\u4fbf\u4e8e\u6d4b\u8bd5\uff0c\u8bbe\u7f6e\u4e3a\u6bcf20\u6b65\u53d1\u9001\u4e00\u6761\u6587\u672c\u3002\u73b0\u5728\uff0c\u8ba9\u6211\u4eec\u50cf\u201csudo python3 ble_steps_line.py\u201d\u4e00\u6837\u8fd0\u884c\u8fd9\u4e2a\u7a0b\u5e8f\uff0c\u8bf7\u8d70\u52a8\u6216\u6447\u52a8SensorMedal\uff0c\u8bd5\u8bd5\u770b\u80fd\u5426\u6b63\u5e38\u6d4b\u91cf\u6b65\u6570\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26648\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-wearable-healthcare-device-02_08.jpg\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-wearable-healthcare-device-02_08.jpg 600w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/raspberrypi-wearable-healthcare-device-02_08.jpg 300w\" alt=\"raspberrypi-wearable-healthcare-device-02_08\" width=\"600\" height=\"431\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u6587\u672c\u5e94\u8be5\u4f1a\u53d1\u9001\u5230\u6307\u5b9a\u7684LINE\u804a\u5929\u5ba4\u4e2d\uff08\u6211\u4e5f\u4e00\u5e76\u53d1\u9001\u4e86\u8868\u60c5\u56fe\uff0c\u8fd9\u4e2a\u60a8\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u559c\u597d\u6dfb\u52a0\uff09\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2022\/10\/raspberrypi-wearable-healthcare-device-02_09.jpg\" alt=\"raspberrypi-wearable-healthcare-device-02_09\" width=\"367\" height=\"496\" class=\"alignnone size-full wp-image-21340\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>3. \u603b\u7ed3<\/h2>\n<p>\u672c\u6587\u662f\u7b2c\u4e8c\u90e8\u5206\uff0c\u6211\u4eec\u5f00\u59cb\u5b9e\u9645\u5236\u4f5c\u8fd9\u6b3e\u7528\u6765\u89e3\u51b3\u8fd0\u52a8\u4e0d\u8db3\u95ee\u9898\u7684\u5065\u5eb7\u7ba1\u7406\u8bbe\u5907\u3002\u7531\u4e8e\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u4eceSensorMedal\u4e2d\u7684\u52a0\u901f\u5ea6\u4f20\u611f\u5668\u83b7\u53d6\u6b65\u6570\uff0c\u56e0\u6b64\u6211\u4f7f\u7528\u901a\u7528\u6570\u503c\u8ba1\u7b97\u5e76\u663e\u793a\u4e86\u79fb\u52a8\u8ddd\u79bb\u548c\u5361\u8def\u91cc\u6d88\u8017\u91cf\u3002\u53e6\u5916\uff0c\u4e3a\u4e86\u63d0\u9ad8\u8fd0\u52a8\u79ef\u6781\u6027\uff0c\u6211\u4eec\u8fd8\u5c06\u7ed3\u679c\u53d1\u9001\u5230\u4e86LINE\u3002<\/p>\n<p>\u600e\u4e48\u6837\uff1f\u628a\u8fd9\u4e2aSensorMedal\u653e\u5728\u8863\u515c\u91cc\uff0c\u5373\u4f7f\u60a8\u5728\u5bb6\u4e2d\uff0c\u4e5f\u53ef\u4ee5\u6709\u610f\u8bc6\u5730\u8fd0\u52a8\uff0c\u662f\u4e0d\u662f\u5f88\u4e0d\u9519\uff1f<\/p>\n<p>\u5728<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/raspberry\/raspberrypi-wearable-healthcare-device-03\/\">\u7b2c\u4e09\u90e8\u5206<\/a>\u4e2d\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u8109\u640f\u4f20\u611f\u5668\u6765\u6d4b\u91cf\u65e5\u5e38\u751f\u6d3b\u548c\u8fd0\u52a8\u8fc7\u7a0b\u4e2d\u7684\u5fc3\u7387\u3002<\/p>\n<div class=\"product_link_box\">\n<span style=\"font-size: 12pt;\"><strong>\u76f8\u5173\u8fde\u8f7d\u4e00\u89c8<\/strong><\/span><\/p>\n<p>\u7b2c1\u90e8\u5206\uff1a<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/raspberry\/raspberrypi-wearable-healthcare-device-01\/\">\u7528Raspberry Pi Zero\u548c\u7f57\u59c6SensorMedal\u5236\u4f5c\u5065\u5eb7\u7ba1\u7406\u8bbe\u5907\uff01<\/a><br \/>\n\u7b2c2\u90e8\u5206\uff1a\u6839\u636e\u4f20\u611f\u5668\u7684\u503c\u8ba1\u7b97\u6b65\u6570\u3001\u8ddd\u79bb\u548c\u5361\u8def\u91cc\uff0c\u5e76\u5c06\u6570\u636e\u53d1\u9001\u5230LINE\uff01\uff08\u672c\u7ae0\uff09<br \/>\n\u7b2c3\u90e8\u5206\uff1a<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/raspberry\/raspberrypi-wearable-healthcare-device-03\/\">\u4e00\u6b3e\u7528Raspberry Pi\u548c\u4f20\u611f\u5668\u5236\u4f5c\u7684\u53ef\u7a7f\u6234\u5f0f\u5c0f\u578b\u5065\u5eb7\u7ba1\u7406\u8bbe\u5907\uff01<\/a><br \/>\n\u7b2c4\u90e8\u5206\uff1a<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/raspberry\/raspberrypi-wearable-healthcare-device-04\/\">\u8fde\u63a5\u663e\u793a\u5668\u5e76\u5b8c\u6210\u8fd9\u6b3e\u53ef\u7a7f\u6234\u5f0f\u5065\u5eb7\u7ba1\u7406\u8bbe\u5907<\/a>\n<\/div>\n<div class=\"author-box-wrapper\">\n<div class=\"avatar-wrapper\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/04\/k.yoshida_avatar.jpg\" alt=\"\u5409\u7530\u3000\u663e\u4e00\uff08Yoshiken\uff09\" width=\"64\" height=\"64\" \/><\/div>\n<div class=\"desc-wrapper\">\n<h5>\u5409\u7530\u3000\u663e\u4e00\uff08Yoshiken\uff09<\/h5>\n<div class=\"desc\">\n<p>\u5728\u666e\u901a\u516c\u53f8\u5de5\u4f5c\u7684\u4e0a\u73ed\u65cf\uff0c\u975e\u5e38\u559c\u6b22\u521b\u4f5c\u7684\u5468\u672b\u521b\u5ba2\uff0c\u51fa\u7248\u4e86\u7535\u5b50\u4e66MESHBOOK\uff0c\u5e73\u65f6\u4e5f\u5199\u5199\u535a\u5ba2\u3002<br \/>\nhttp:\/\/blog.ktrips.net\n<\/p><\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"\u7b2c1\u90e8\u5206\uff1a\u7528Raspberry Pi Zero\u548c\u7f57\u59c6SensorMedal\u5236\u4f5c\u5065\u5eb7\u7ba1\u7406\u8bbe\u5907\uff01 &nbsp; \u6839\u636e\u4f20\u611f\u5668\u7684\u503c\u8ba1\u7b97\u6b65\u6570\u3001\u8ddd\u79bb\u548c\u5361\u8def\u91cc\uff0c\u5e76\u5c06\u6570\u636e\u53d1\u9001\u5230LINE\uff01 \u5927\u5bb6\u597d\uff0c\u6211\u662f\u5409\u7530\uff01 \u4ece\u8fd9\u90e8\u5206\u5f00\u59cb\uff0c\u6211\u4eec\u5c06\u7740\u624b\u5236\u4f5c [&hellip;]","protected":false},"author":4,"featured_media":21330,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1132],"tags":[],"class_list":["post-21298","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-raspberry"],"acf":[],"wps_subtitle":"","_links":{"self":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/21298","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/comments?post=21298"}],"version-history":[{"count":11,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/21298\/revisions"}],"predecessor-version":[{"id":29528,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/21298\/revisions\/29528"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/media\/21330"}],"wp:attachment":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/media?parent=21298"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/categories?post=21298"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/tags?post=21298"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}