{"id":21847,"date":"2022-12-22T00:00:38","date_gmt":"2022-12-21T16:00:38","guid":{"rendered":"https:\/\/techclass.wfjydl.com\/?p=21847"},"modified":"2026-05-07T12:15:51","modified_gmt":"2026-05-07T04:15:51","slug":"%e7%94%a8raspberry-pi%e5%92%8csensormedal%e5%88%b6%e4%bd%9ciot%e8%b7%b3%e7%bb%b3%e8%ae%be%e5%a4%87","status":"publish","type":"post","link":"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/arduino\/arduino-advanced\/raspberrypi-iot-jumprope-device-02","title":{"rendered":"\u7528Raspberry Pi\u548cSensorMedal\u5236\u4f5cIoT\u8df3\u7ef3\u8bbe\u5907 \u7b2c\u4e8c\u90e8\u5206\uff1a\u7528SensorMedal\u68c0\u6d4b\u8df3\u8dc3\u6b21\u6570\u5e76\u5728\u663e\u793a\u5668\u4e0a\u663e\u793a"},"content":{"rendered":"<p>\u7b2c\u4e00\u90e8\u5206\uff1a<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/arduino\/arduino-advanced\/raspberrypi-iot-jumprope-device-01\/\">\u7528\u8df3\u7ef3\u6d4b\u8bd5\u4eea\u89e3\u51b3\u8fd0\u52a8\u4e0d\u8db3\u95ee\u9898\uff01<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u5927\u5bb6\u597d\uff0c\u6211\u662f\u5409\u7530\uff01<\/p>\n<p>\u5728<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/arduino\/arduino-advanced\/raspberrypi-iot-jumprope-device-01\/\">\u7b2c\u4e00\u90e8\u5206<\/a>\u4e2d\uff0c\u6211\u4eec\u7b80\u8981\u4ecb\u7ecd\u4e86\u672c\u9879\u76ee\u4ee5\u53ca\u6240\u9700\u7684\u51c6\u5907\u5de5\u4f5c\uff0c\u4ece\u7b2c\u4e8c\u90e8\u5206\u5f00\u59cb\uff0c\u6211\u4eec\u5c06\u7740\u624b\u5236\u4f5c\u8fd9\u6b3e\u65e8\u5728\u89e3\u51b3\u8fd0\u52a8\u4e0d\u8db3\u95ee\u9898\u7684\u8df3\u7ef3\u8bbe\u5907\u3002\u9996\u5148\uff0c\u8ba9\u6211\u4eec\u5c1d\u8bd5\u5728\u8df3\u7ef3\u4e0a\u9644\u52a0SensorMedal\uff0c\u5e76\u68c0\u6d4b\u8df3\u8dc3\u6b21\u6570\u5427\u3002\u5728\u56db\u4f4d\u663e\u793a\u5668\u4e0a\u4ee5\u6570\u5b57\u5f62\u5f0f\u663e\u793a\u6b21\u6570\uff0c\u53ef\u4ee5\u65b9\u4fbf\u60a8\u968f\u65f6\u67e5\u770b\u8df3\u8dc3\u6b21\u6570\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26988\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-01.jpg\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-01.jpg 750w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-01.jpg 300w\" alt=\"raspberrypi-iot-jumprope-device-02-01\" width=\"750\" height=\"315\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>\u672c\u90e8\u5206\u6240\u9700\u90e8\u4ef6<\/h2>\n<h3>\u8df3\u7ef3<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26919\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-01-03.jpg\" sizes=\"auto, (max-width: 384px) 100vw, 384px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-01-03.jpg 384w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-01-03.jpg 294w\" alt=\"raspberrypi-iot-jumprope-device-01-03\" width=\"384\" height=\"392\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>极悦娱乐 SensorMedal\uff08<a href=\"https:\/\/www.chip1stop.com\/product\/detail?partId=极悦娱乐-0171151&amp;mpn=SensorMedal-EVK-002\" target=\"_blank\" rel=\"noopener\">SensorMedal-EVK-002<\/a>\uff09<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26920\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-01-04.jpg\" sizes=\"auto, (max-width: 428px) 100vw, 428px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-01-04.jpg 428w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-01-04.jpg 300w\" alt=\"raspberrypi-iot-jumprope-device-01-04\" width=\"428\" height=\"304\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>Raspberry Pi zero\uff08<a href=\"https:\/\/amzn.to\/2YDlNTL\" target=\"_blank\" rel=\"noopener\">Raspberry Pi Zero W<\/a>\uff09<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26921\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-01-05.jpg\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-01-05.jpg 400w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-01-05.jpg 300w\" alt=\"raspberrypi-iot-jumprope-device-01-05\" width=\"400\" height=\"254\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><a href=\"https:\/\/amzn.to\/2ZBgynM\" target=\"_blank\" rel=\"noopener\">FOUR LETTER LED PHAT<\/a><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26922\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-01-06.jpg\" sizes=\"auto, (max-width: 428px) 100vw, 428px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-01-06.jpg 428w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-01-06.jpg 300w\" alt=\"raspberrypi-iot-jumprope-device-01-06\" width=\"428\" height=\"176\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>\u672c\u90e8\u5206\u7684\u6d41\u7a0b<\/h2>\n<ol>\n<li><a href=\"#01\">\u7528SensorMedal\u8fdb\u884c\u8df3\u7ef3\u8ba1\u6570<\/a><\/li>\n<li><a href=\"#02\">\u5728\u56db\u4f4d\u663e\u793a\u5668\u4e0a\u663e\u793a<\/a><\/li>\n<li><a href=\"#03\">\u8df3\u7ef3\u5e76\u663e\u793a\u6b21\u6570<\/a><\/li>\n<li><a href=\"#04\">\u603b\u7ed3<\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h2 id=\"01\">1. \u7528SensorMedal\u8fdb\u884c\u8df3\u7ef3\u8ba1\u6570<\/h2>\n<p>\u5728\u5236\u4f5c\u8df3\u7ef3\u8bbe\u5907\u65f6\uff0c\u9700\u8981\u51c6\u5907\u4e00\u6839\u8df3\u7ef3\u3002\u5bf9\u8df3\u7ef3\u6ca1\u6709\u683c\u5916\u8981\u6c42\uff0c\u5982\u679c\u53ef\u80fd\u7684\u8bdd\uff0c\u6700\u597d\u4f7f\u7528\u624b\u67c4\u8f83\u7c97\u8f83\u957f\u7684\uff0c\u8fd9\u6837\u66f4\u5bb9\u6613\u64cd\u4f5c\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26989\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-02.jpg\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-02.jpg 750w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-02.jpg 300w\" alt=\"raspberrypi-iot-jumprope-device-02-02\" width=\"750\" height=\"562\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>\u7136\u540e\uff0c\u8003\u8651\u8ba1\u7b97\u8df3\u8dc3\u6b21\u6570\u7684\u65b9\u6cd5\u3002\u6700\u76f4\u63a5\u7684\u529e\u6cd5\u5c31\u662f\u5bf9\u8df3\u7ef3\u65cb\u8f6c\u90e8\u5206\u6bcf\u8f6c\u4e00\u5708\u8ba1\u4e00\u6b21\u8fd9\u6837\u8fdb\u884c\u8ba1\u6570\u3002\u8fd9\u4e2a\u53ef\u4ee5\u901a\u8fc7\u5c06\u78c1\u94c1\u7b49\u8fde\u63a5\u5230\u8df3\u7ef3\u7684\u65cb\u8f6c\u7aef\u5e76\u7528\u970d\u5c14\u4f20\u611f\u5668\u5bf9\u5176\u8fdb\u884c\u68c0\u6d4b\u6765\u5b9e\u73b0\u3002\u7136\u800c\uff0c\u5728\u65cb\u8f6c\u90e8\u5206\u5b89\u88c5\u970d\u5c14\u4f20\u611f\u5668\u5e76\u5b89\u88c5\u7528\u6765\u83b7\u53d6\u68c0\u6d4b\u7ed3\u679c\u7684\u7535\u8def\uff0c\u8fd8\u6d89\u53ca\u5230\u7a7a\u95f4\u95ee\u9898\uff0c\u96be\u5ea6\u8f83\u9ad8\u3002<\/p>\n<p>\u8fd9\u6b21\u6211\u4eec\u4f7f\u7528SensorMedal\u7684\u52a0\u901f\u5ea6\u4f20\u611f\u5668\u6765\u68c0\u6d4b\u8df3\u7ef3\u624b\u67c4\u90e8\u5206\u7684\u52a0\u901f\u5ea6\uff0c\u5e76\u4f5c\u4e3a\u8df3\u8dc3\u6b21\u6570\u6765\u8ba1\u6570\u3002\u8fd9\u6837\u7684\u8bdd\uff0c\u8fd8\u53ef\u4ee5\u6355\u6349\u53cc\u98de\u548c\u53cc\u81c2\u4ea4\u53c9\u8df3\u7b49\u7684\u52a8\u4f5c\uff0c\u4e5f\u8bb8\u8fd8\u53ef\u4ee5\u68c0\u6d4b\u51fa\u8df3\u6cd5\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26990\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2022\/12\/raspberrypi-iot-jumprope-device-02-03.png\" sizes=\"auto, (max-width: 456px) 100vw, 456px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2022\/12\/raspberrypi-iot-jumprope-device-02-03.png 456w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2022\/12\/raspberrypi-iot-jumprope-device-02-03.png 300w\" alt=\"raspberrypi-iot-jumprope-device-02-03\" width=\"456\" height=\"354\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>\u73b0\u5728\uff0c\u6211\u4eec\u5148\u5c06\u7ebd\u6263\u7535\u6c60CR2450\u88c5\u5165SensorMedal\u4e2d\u5e76\u6253\u5f00\u7535\u6e90\u3002\u7528\u624e\u5e26\u7b49\u5c06\u5df2\u7ecf\u63a5\u901a\u7535\u6e90\u7684SensorMedal\u8fde\u63a5\u5230\u8df3\u7ef3\u7684\u624b\u67c4\u4e0a\u3002SensorMedal\u5f88\u8f7b\uff0c\u800c\u4e14\u5c3a\u5bf8\u4e0d\u5927\uff0c\u6240\u4ee5\u6211\u8ba4\u4e3a\u88c5\u4e0a\u5b83\u5e76\u4e0d\u4f1a\u59a8\u788d\u8df3\u7ef3\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26991\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-04.jpg\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-04.jpg 750w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-04.jpg 300w\" alt=\"raspberrypi-iot-jumprope-device-02-04\" width=\"750\" height=\"562\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u51c6\u5907\u7528Raspberry Pi Zero\u6765\u63a5\u6536\u8fd9\u4e2aSensorMedal\u7684\u4f20\u611f\u5668\u503c\u3002\u53e6\u5916\uff0c\u5b89\u88c5\u4e00\u4e2a<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/raspberry\/raspberrypi-comfortable-space-device-02\/\">\u540d\u4e3a\u201cbluepy\u201d\u7684\u5e93<\/a>\uff0c\u4ee5\u4fbf\u7528\u84dd\u7259\u5c06Raspberry Pi\u548cSensorMedal\u8fde\u63a5\u8d77\u6765\u3002<\/p>\n<p>\u7136\u540e\uff0c\u4f7f\u7528Github\uff08<a href=\"http:\/\/github.com\/bokunimowakaru\/SensorMedal2\" target=\"_blank\" rel=\"noopener\">http:\/\/github.com\/bokunimowakaru\/SensorMedal2<\/a>\uff09\u4e0a\u7684\u4fbf\u5229\u7a0b\u5e8f\u6765\u663e\u793a\u4eceSensorMedal\u63a5\u6536\u5230\u7684\u6570\u503c\u3002\u4f7f\u7528\u201cgit clone\u201d\u4e0b\u8f7d\u7a0b\u5e8f\u3002<\/p>\n<p>\u8fd0\u884c\u793a\u4f8b\u7a0b\u5e8fble_logger_SensorMedal2.py\u3002<\/p>\n<pre class=\"brush: cpp; title: Code-Example; notranslate\" title=\"Code-Example\">pi@raspizero:~ $ sudo pip3 install bluepy\r\nLooking in indexes: https:\/\/pypi.org\/simple, https:\/\/www.piwheels.org\/simple\r\nCollecting bluepy \r\nInstalling collected packages: bluepy\r\nSuccessfully installed bluepy-1.3.0\r\n\r\npi@raspizero:~ $ sudo git clone http:\/\/github.com\/bokunimowakaru\/SensorMedal2\r\nCloning into 'SensorMedal2'...\r\nUnpacking objects: 100% (78\/78), done.\r\n\r\npi@raspizero:~ $ cd SensorMedal2\/\r\npi@raspizero:~\/SensorMedal2 $ sudo python3 ble_logger_SensorMedal2.py\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>\u4f5c\u4e3a\u52a0\u901f\u5ea6\uff0cSensorMedal\u8f93\u51faAccelerometer\u4e0a\u7684x\u3001y \u3001z\u8f74\u7684\u52a0\u901f\u5ea6\uff0c\u4ee5\u53ca\u5408\u6210\u7684\u91cd\u529b\u52a0\u901f\u5ea6(g)\u3002\u5728\u524d\u9762\u7684\u56fe\u4e2d\uff0c\u8df3\u7ef3\u65f6\u7684\u91cd\u529b\u52a0\u901f\u5ea6\u4e3a2\u301c4g\uff0cSensorMedal\u4ee5\u76f8\u4f3c\u7684\u5f62\u5f0f\uff0c\u68c0\u6d4b\u5230\u4e00\u5b9a\u7684\u91cd\u529b\u52a0\u901f\u5ea6\uff0c\u5e76\u8f93\u51faSteps\u7684\u503c\u3002\u8fd9\u6b21\u6211\u4eec\u5c06\u4f7f\u7528\u8fd9\u4e2a\u6570\u503c\u4f5c\u4e3a\u8df3\u7ef3\u65f6\u7684\u8df3\u8dc3\u6b21\u6570\u3002<br \/>\n\u53e6\u5916\uff0c\u8fd8\u9700\u8981\u8ba1\u7b97\u4e00\u4e0b\u8df3\u7ef3\u65f6\u6d88\u8017\u7684\u5361\u8def\u91cc\u3002\u5728\u7b2c\u4e00\u90e8\u5206\u7684\u6587\u7ae0\u4e2d\uff0c\u63d0\u5230\u8fc7\u901a\u8fc7\u5361\u8def\u91cc\u8ba1\u7b97\uff0c\u53ef\u77e5\u6bcf\u5206\u949f\u8df3100\u6b21\u5de6\u53f3\u3001\u8df330\u5206\u949f\u6d88\u8017\u7684\u5361\u8def\u91cc\u662f270\u5927\u5361\uff0c\u6240\u4ee5\u6211\u4eec\u76f4\u63a5\u4f7f\u7528\u8fd9\u4e2a\u6570\u503c\u3002<br \/>\n\uff08\u6bcf\u8df3\u4e00\u6b21\u6d88\u8017\u7684\u5361\u8def\u91cc=270\u5927\u5361\/30*100\u6b21\u22520.1\u5927\u5361\/\u6b21\uff09<\/p>\n<p>\u4f7f\u7528\u4e86\u8be5\u6570\u503c\u7684Python\u7a0b\u5e8fble_jump.py\u5982\u4e0b\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_jump.py\r\n\r\n--- \u4e0b\u9762\u7684\u7b2c5\u301c7\u3001\u7b2c12\u3001\u7b2c16\u301c18\u3001\u7b2c42\u301c55\u884c\u662f\u66f4\u6539\u6216\u6dfb\u52a0\u90e8\u5206 ---\r\n\r\ninterval = 1 #\u52a8\u4f5c\u95f4\u9694\r\nstart_seq = 0\r\njump_cnt = 0\r\n\r\n---\r\n    # \u6bcf\u4e2aBLE\u8bbe\u5907\u7684\u63a5\u6536\u6570\u636e\u5904\u7406\r\n    for dev in devices:\r\n        # print(\"\\nDevice %s (%s), RSSI=%d dB\" % (dev.addr, dev.addrType, dev.rssi))\r\n        isRohmMedal = False\r\n        sensors = dict()\r\n        for (adtype, desc, val) in dev.getScanData():\r\n            # print(\"  %s = %s\" % (desc, val))\r\n            if desc == 'Short Local Name' and val[0:18] == '极悦娱乐Medal2_xxxx_xx': # \u5728xxxx_xx\u4e2d\u8f93\u5165\u60a8\u4f7f\u7528\u7684SensorMedal\u7f16\u53f7\r\n                print(\u201cJUMP!\u201d)\r\n                isRohmMedal = True\r\n            if isRohmMedal and desc == 'Manufacturer':\r\n---\r\n               # \u5728\u663e\u793a\u5668\u4e0a\u663e\u793a\r\n                print('    ID            =',sensors['ID'])\r\n                print('    SEQ           =',sensors['SEQ'])\r\n                \u201c\u201d\u201d print('    Temperature   =',round(sensors['Temperature'],2),'\u2103')\r\n                print('    Humidity      =',round(sensors['Humidity'],2),'%')\r\n                print('    Pressure      =',round(sensors['Pressure'],3),'hPa')\r\n                print('    Illuminance   =',round(sensors['Illuminance'],1),'lx')\r\n                print('    Accelerometer =',round(sensors['Accelerometer'],3),'g (',\\\r\n                                            round(sensors['Accelerometer X'],3),\\\r\n                                            round(sensors['Accelerometer Y'],3),\\\r\n                                            round(sensors['Accelerometer Z'],3),'g)')\r\n                print('    Geomagnetic   =',round(sensors['Geomagnetic'],1),'uT (',\\\r\n                                            round(sensors['Geomagnetic X'],1),\\\r\n                                            round(sensors['Geomagnetic Y'],1),\\\r\n                                            round(sensors['Geomagnetic Z'],1),'uT)')\r\n                print('    Magnetic      =',sensors['Magnetic'])\r\n                print('    Steps         =',sensors['Steps'],'\u6b69')\r\n                print('    Battery Level =',sensors['Battery Level'],'%')\r\n                print('    RSSI          =',sensors['RSSI'],'dB') \u201d\u201d\u201d\r\n\r\n                SEQ = sensors['SEQ']\r\n                jump_cnt = sensors['Steps']\r\n\r\n                if SEQ in [0,1] and jump_cnt == 0:\r\n                    start_seq+= 1\r\n                    print(\u201cSTART!\")\r\n                else:\r\n                    last_cnt = jump_cnt\r\n\r\n                if start_seq &gt;= 1:\r\n                    cur_cnt = jump_cnt\r\n                    cur_cal = round(cur_cnt*0.1,1)\r\n                    jump_text= str(cur_cnt)+\" Jump \"+str(cur_cal)+\" Cal\"\r\n                    print(jump_text)\r\n\r\n               '''\r\n                for key, value in sorted(sensors.items(), key=lambda x:x[0]):\r\n                    print('    ',key,'=',value)\r\n                '''\r\n<\/pre>\n<p>\u50cfsudo python3 ble_jump.py\u4e00\u6837\u8fd0\u884c\u8fd9\u4e2a\u7a0b\u5e8f\u540e\uff0c\u6309\u4e00\u4e0bSensorMedal\u4e0a\u7684\u5f00\u5173\u3002\u73b0\u5728\uff0c\u53ef\u4ee5\u8df3\u7ef3\u4e86\uff01\u60a8\u770b\u5230\u5982\u4e0b\u663e\u793a\u7684\u8df3\u8dc3\u6b21\u6570\u548c\u71c3\u70e7\u7684\u5361\u8def\u91cc\u4e86\u5417\uff1f<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26992\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-05.png\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-05.png 750w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-05.png 300w\" alt=\"raspberrypi-iot-jumprope-device-02-05\" width=\"750\" height=\"407\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"02\">2. \u5728\u56db\u4f4d\u663e\u793a\u5668\u4e0a\u663e\u793a<\/h2>\n<p>\u83b7\u5f97\u8df3\u8dc3\u6b21\u6570\u540e\uff0c\u6211\u4eec\u5c1d\u8bd5\u5728\u624b\u8fb9\u663e\u793a\u8be5\u6570\u503c\u5427\u3002\u8fd9\u6b21\u6211\u4eec\u4f7f\u7528\u53ef\u4e0eRaspberry Pi Zero\u5b8c\u7f8e\u517c\u5bb9\u7684Pimoroni\u7684\u56db\u4f4d\u663e\u793a\u5668\u3002\u8fd9\u4e2a\u663e\u793a\u5668\u7531\u6bcf\u4e2a\u5b57\u7b26\u7684\u663e\u793a\u5668\u548c\u7535\u8def\u677f\u7ec4\u6210\uff0c\u6240\u4ee5\u9700\u8981\u628a\u5b83\u4eec\u710a\u63a5\u8d77\u6765\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26993\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-06.jpg\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-06.jpg 750w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-06.jpg 300w\" alt=\"raspberrypi-iot-jumprope-device-02-06\" width=\"750\" height=\"400\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>\u4e0b\u9762\u7684\u7167\u7247\u662f\u710a\u63a5\u597d\u7684\u72b6\u6001\uff08\u710a\u5f97\u6709\u70b9\u7c97\u7cd9\uff09\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26994\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-07.jpg\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-07.jpg 750w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-07.jpg 300w\" alt=\"raspberrypi-iot-jumprope-device-02-07\" width=\"750\" height=\"190\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>\u710a\u63a5\u5b8c\u6210\u540e\uff0c\u5c06Pimoroni\u63d0\u4f9b\u7684\u5e93\u5b89\u88c5\u5230Raspberry Pi\u4e0a\u3002\u8bf7\u8bbf\u95ee\u4e0b\u9762\u7684Github\uff1a<\/p>\n[ Pimoroni \u56db\u4f4d\u663e\u793a\u5668\u7684 Github <a href=\"https:\/\/github.com\/pimoroni\/fourletter-phat\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/pimoroni\/fourletter-phat<\/a> ]\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26995\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-08.png\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-08.png 750w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-08.png 300w\" alt=\"raspberrypi-iot-jumprope-device-02-08\" width=\"750\" height=\"573\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>\u6216\u8005\u53ea\u9700\u4f7f\u7528Raspberry Pi\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n<pre class=\"brush: cpp; title: Code-Example; notranslate\" title=\"Code-Example\">$ curl https:\/\/get.pimoroni.com\/fourletterphat | bash\r\n<\/pre>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u5c06\u4f1a\u5728\u540d\u4e3a\u201cPimoroni\u201d\u7684\u76ee\u5f55\u4e0b\u627e\u5230\u4e00\u4e2a\u540d\u4e3a\u201cfourletter-phat\u201d\u7684\u663e\u793a\u793a\u4f8b\u7a0b\u5e8f\u3002\u5728\u8fd9\u4e2a\u793a\u4f8b\u7a0b\u5e8f\u4e2d\uff0c\u8ba9\u6211\u4eec\u8fd0\u884c\u4e00\u4e0b\u7a0b\u5e8f (clock.py)\uff0c\u663e\u793a\u5f53\u524d\u65f6\u95f4\u4f5c\u4e3a\u65f6\u949f\u3002<\/p>\n<pre class=\"brush: cpp; title: Code-Example; notranslate\" title=\"Code-Example\">$ python ~\/Pimoroni\/fourletter-phat\/examples\/clock.py\r\n<\/pre>\n<p>\u5f53\u524d\u65f6\u95f4\u663e\u793a\u5982\u4e0b\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26996\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-09.jpg\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-09.jpg 750w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-09.jpg 300w\" alt=\"raspberrypi-iot-jumprope-device-02-09\" width=\"750\" height=\"512\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"03\">3. \u8df3\u7ef3\u5e76\u663e\u793a\u6b21\u6570<\/h2>\n<p>\u6211\u4eec\u5df2\u7ecf\u5b9e\u73b0\u4e86\u56db\u4f4d\u6570\u5b57\u7684\u663e\u793a\uff0c\u73b0\u5728\u6211\u4eec\u5c1d\u8bd5\u663e\u793a\u8df3\u7ef3\u65f6\u7684\u8df3\u8dc3\u6b21\u6570\u3002\u53ea\u9700\u590d\u5236ble_jump.py\u5e76\u6dfb\u52a0\u4e0b\u9762\u7684\u6d45\u84dd\u8272\u90e8\u5206\u5373\u53ef\u521b\u5efa\u4e3able_jump_4d.jpy\u3002<\/p>\n<pre class=\"brush: cpp; title: Code-Example; notranslate\" title=\"Code-Example\">pi@raspizero:~\/Programs $ sudo cp ble_jump.py ble_jump_4d.py\r\n\r\n--- \u4e0b\u9762\u7684\u7b2c4\u300111\u300112\u884c\u4e3a\u66f4\u6539\u6216\u6dfb\u52a0\u90e8\u5206 ---\r\nimport fourletterphat\r\n---\r\n                if start_seq &gt;= 1:\r\n                    cur_cnt = jump_cnt\r\n                    cur_cal = round(cur_cnt*0.1,1)\r\n                    jump_text= str(cur_cnt)+\" Jump \"+str(cur_cal)+\" Cal\"\r\n                    print(jump_text)\r\n                    fourletterphat.print_number_str(cur_cnt)\r\n                    fourletterphat.show()\r\n               '''\r\n                for key, value in sorted(sensors.items(), key=lambda x:x[0]):\r\n                    print('    ',key,'=',value)\r\n                '''\r\n<\/pre>\n<p>\u6700\u540e\uff0c\u8ba9\u6211\u4eec\u66f4\u7ec6\u81f4\u5730\u5b89\u88c5SensorMedal\u548cRaspberry Pi\u3002\u9996\u5148\uff0c\u6211\u51b3\u5b9a\u5c06\u5b83\u4eec\u5b89\u88c5\u5230\u8df3\u7ef3\u624b\u67c4\u4e0a\u65b9\u76f8\u5bf9\u5e73\u5766\u7684\u4f4d\u7f6e\u3002\u4f7f\u7528\u8f83\u5927\u5200\u5177\u7b49\u5728\u4e0a\u90e8\u5f00\u4e00\u4e2a\u5b54\uff0c\u4ee5\u4fbfRaspberry Pi Zero\u7684\u5f15\u811a\u6b63\u597d\u5d4c\u5165\u8fdb\u53bb\u3002\u5728\u5f00\u5b54\u4f4d\u7f6e\u7684\u80cc\u9762\u5b89\u88c5Raspberry Pi\uff0c\u6b63\u9762\u5b89\u88c5\u56db\u4f4d\u663e\u793a\u5668\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26997\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-10.jpg\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-10.jpg 750w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-10.jpg 300w\" alt=\"raspberrypi-iot-jumprope-device-02-10\" width=\"750\" height=\"480\" \/><br \/>\n\u6ce8\u610f\u4e0d\u8981\u8ba9\u5b83\u4eec\u5e72\u6d89\u7ef3\u7d22\u90e8\u5206\uff0c\u5c06Raspberry Pi\u548c\u56db\u4f4d\u663e\u793a\u5668\u56fa\u5b9a\u5728\u5f00\u5b54\u7684\u4e24\u9762\u5b89\u88c5\u597d\u4e4b\u540e\uff0c\u8df3\u7ef3\u8bbe\u5907\u5c31\u5236\u4f5c\u5b8c\u6210\u5566\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26998\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-11.jpg\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-11.jpg 750w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-11.jpg 300w\" alt=\"raspberrypi-iot-jumprope-device-02-11\" width=\"750\" height=\"480\" \/><\/p>\n<p>&nbsp;<\/p>\n<p> \u73b0\u5728\u8ba9\u6211\u4eec\u8fd0\u884cble_jump_4d.py\u5e76\u5f00\u59cb\u8df3\u7ef3\u5427\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-26999\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-12.jpg\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-12.jpg 750w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2026\/05\/raspberrypi-iot-jumprope-device-02-12.jpg 300w\" alt=\"raspberrypi-iot-jumprope-device-02-12\" width=\"750\" height=\"260\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2 id=\"04\">4. \u603b\u7ed3<\/h2>\n<p>\u81f3\u6b64\uff0c\u6211\u4eec\u6210\u529f\u5730\u4f7f\u7528Raspberry Pi\u548cSensorMedal\u5b9e\u73b0\u4e86\u8df3\u7ef3\u7684\u6570\u5b57\u5316\uff0c\u5e76\u5173\u8054\u7269\u8054\u7f51\u3002\u5f53\u521d\u7684\u8ba1\u5212\u662f\u5236\u4f5c\u4e00\u6b3e\u901a\u8fc7\u8f7b\u677e\u7684\u8df3\u7ef3\u8fd0\u52a8\u6765\u52a9\u529b\u89e3\u51b3\u8fd0\u52a8\u4e0d\u8db3\u95ee\u9898\u7684\u8bbe\u5907\u3002<\/p>\n<p>\u6211\u4eec\u5df2\u7ecf\u5b9e\u73b0\u4e86\u57fa\u672c\u7684\u529f\u80fd\uff1a\u8df3\u8dc3\u6b21\u6570\u8ba1\u91cf\u548c\u663e\u793a\u6b21\u6570\u3002\u60a8\u53ef\u4ee5\u8bd5\u7528\u4e00\u4e0b\u8fd9\u6b3e\u8df3\u7ef3\uff0c\u770b\u770b\u5b83\u662f\u5426\u80fd\u591f\u6b63\u786e\u8ba1\u6570\u3002<\/p>\n<p>\u5728\u4e0b\u4e00\u90e8\u5206\u4e2d\uff0c\u6211\u4eec\u4f1a\u5c06\u521b\u5efa\u6fc0\u53d1\u52a8\u529b\u7684\u673a\u5236\uff0c\u5c06\u8df3\u7ef3\u8fde\u63a5\u5230\u4e92\u8054\u7f51\uff0c\u4ee5\u4fdd\u5b58\u548c\u663e\u793a\u4ee5\u5f80\u7684\u6b21\u6570\u548c\u6d88\u8017\u7684\u5361\u8def\u91cc\u3002<\/p>\n<p>\u656c\u8bf7\u671f\u5f85\uff01<\/p>\n<div class=\"product_link_box\">\n<span style=\"font-size: 12pt;\"><strong>\u672c\u7cfb\u5217\u8fde\u8f7d\u4e00\u89c8<\/strong><\/span><\/p>\n<p>\u7b2c\u4e00\u90e8\u5206\uff1a<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/arduino\/arduino-advanced\/raspberrypi-iot-jumprope-device-01\/\">\u7528\u8df3\u7ef3\u6d4b\u8bd5\u4eea\u89e3\u51b3\u8fd0\u52a8\u4e0d\u8db3\u95ee\u9898\uff01<\/a><br \/>\n\u7b2c\u4e8c\u90e8\u5206\uff1a\u7528SensorMedal\u68c0\u6d4b\u8df3\u8dc3\u6b21\u6570\u5e76\u5728\u663e\u793a\u5668\u4e0a\u663e\u793a\uff08\u672c\u7ae0\uff09<br \/>\n\u7b2c\u4e09\u90e8\u5206\uff1a<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/arduino\/arduino-advanced\/raspberrypi-iot-jumprope-device-03\/\">\u8fde\u63a5Google Drive\uff0c\u4fdd\u5b58\u5e76\u67e5\u770b\u8df3\u7ef3\u7ed3\u679c<\/a><br \/>\n\u7b2c\u56db\u90e8\u5206\uff1a<a href=\"https:\/\/deviceplus.jp\/arduino\/raspberrypi-iot-jumprope-device-04\/\">\u5728\u8bbe\u5907\u4e0a\u5b89\u88c5\u663e\u793a\u5668\u4ee5\u589e\u52a0\u52a8\u529b\uff01<\/a>\n<\/div>\n<div class=\"author-box-wrapper\">\n<div class=\"avatar-wrapper\">\n\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2022\/11\/Yoshiken.png\" width=\"128\" height=\"128\" alt=\"\u5409\u7530\u3000\u663e\u4e00\uff08Yoshiken\uff09\">\n\t<\/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>\n<\/div><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"\u7b2c\u4e00\u90e8\u5206\uff1a\u7528\u8df3\u7ef3\u6d4b\u8bd5\u4eea\u89e3\u51b3\u8fd0\u52a8\u4e0d\u8db3\u95ee\u9898\uff01 &nbsp; \u5927\u5bb6\u597d\uff0c\u6211\u662f\u5409\u7530\uff01 \u5728\u7b2c\u4e00\u90e8\u5206\u4e2d\uff0c\u6211\u4eec\u7b80\u8981\u4ecb\u7ecd\u4e86\u672c\u9879\u76ee\u4ee5\u53ca\u6240\u9700\u7684\u51c6\u5907\u5de5\u4f5c\uff0c\u4ece\u7b2c\u4e8c\u90e8\u5206\u5f00\u59cb\uff0c\u6211\u4eec\u5c06\u7740\u624b\u5236\u4f5c\u8fd9\u6b3e\u65e8\u5728\u89e3\u51b3\u8fd0\u52a8\u4e0d\u8db3\u95ee\u9898\u7684\u8df3\u7ef3\u8bbe\u5907\u3002\u9996\u5148\uff0c\u8ba9\u6211\u4eec\u5c1d\u8bd5\u5728\u8df3\u7ef3\u4e0a [&hellip;]","protected":false},"author":4,"featured_media":21932,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1977],"tags":[1975,1976,1978,1979],"class_list":["post-21847","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino-advanced","tag-raspberry-pi","tag-raspberry-pi4","tag-iot","tag-raspberry-pi-zero"],"acf":[],"wps_subtitle":"","_links":{"self":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/21847","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=21847"}],"version-history":[{"count":15,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/21847\/revisions"}],"predecessor-version":[{"id":29837,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/21847\/revisions\/29837"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/media\/21932"}],"wp:attachment":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/media?parent=21847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/categories?post=21847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/tags?post=21847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}