{"id":2634,"date":"2019-06-13T08:09:32","date_gmt":"2019-06-13T08:09:32","guid":{"rendered":""},"modified":"2019-06-13T16:09:56","modified_gmt":"2019-06-13T08:09:56","slug":"%e5%88%a9%e7%94%a8micropython%e8%ae%be%e8%ae%a1%e5%b5%8c%e5%85%a5%e5%bc%8f%e7%b3%bb%e7%bb%9f%e7%9a%84%e4%bc%98%e7%bc%ba%e7%82%b9","status":"publish","type":"post","link":"http:\/\/www.szryc.com\/?p=2634","title":{"rendered":"\u5229\u7528MicroPython\u8bbe\u8ba1\u5d4c\u5165\u5f0f\u7cfb\u7edf\u7684\u4f18\u7f3a\u70b9"},"content":{"rendered":"

\n\tC \/ C ++\u7f16\u7a0b\u8bed\u8a00\u957f\u671f\u4ee5\u6765\u4e00\u76f4\u4e3b\u5bfc\u7740\u5d4c\u5165\u5f0f\u7cfb\u7edf\u884c\u4e1a\uff0c\u5f88\u5c11\u6709\u5176\u4ed6\u8bed\u8a00\u53ef\u4ee5\u627e\u5230\u7acb\u8db3\u70b9\u3002\u867d\u7136Java<\/u>\u548cAda\u7b49\u8bed\u8a00\u5df2\u7ecf\u5c1d\u8bd5\u8fc7\uff0c\u4f46Python<\/u>\u7684\u6d41\u884c\u7a0b\u5ea6\u4e0d\u4ec5\u5728\u4e0d\u65ad\u63d0\u9ad8\uff0c\u800c\u4e14\u5df2\u7ecf\u5728\u57fa\u4e8eLinux<\/u>\u7684\u5e94\u7528\u7a0b\u5e8f\u4e2d\u627e\u5230\u4e86\u5f88\u957f\u4e00\u6bb5\u65f6\u95f4\u3002\u4f46\u662f\uff0c\u7528\u4e8e\u5fae\u63a7\u5236\u5668\u7684Python\u4f3c\u4e4e\u4ece\u672a\u50cfMi<\/u>croPython\u90a3\u6837\u9002\u5408\u8be5\u6cd5\u6848\uff0cMicroPython\u662f\u4e00\u4e2a\u8bbe\u8ba1\u7528\u4e8e\u5728\u5fae\u63a7\u5236\u5668\u4e0a\u8fd0\u884c\u7684Python 3.0\u7aef\u53e3\u3002\u968f\u7740\u8be5\u9879\u76ee\u73b0\u5df2\u8fdb\u5165\u7b2c\u516d\u4e2a\u5e74\u5934\uff0c\u5b83\u5df2\u7ecf\u8d8a\u6765\u8d8a\u53d7\u6b22\u8fce\u548c\u53d1\u5c55\u52bf\u5934\uff0c\u4f7f\u5176\u6210\u4e3a\u60a8\u7528\u6765\u8bbe\u8ba1\u4e0b\u4e00\u4e2a\u4ea7\u54c1\u7684\u7f16\u7a0b\u8bed\u8a00\u3002<\/p>\n

\n\t\u8ba9\u6211\u4eec\u6765\u770b\u770b\u4f7f\u7528MicroPython\u7684\u4e00\u4e9b\u4f18\u7f3a\u70b9\uff1a<\/p>\n

\n\t <\/div>\n

\n\tPython\u7f16\u7a0b\u8bed\u8a00\u5177\u6709\u6d45\u8584\u7684\u5b66\u4e60\u66f2\u7ebf\uff0c\u8fd9\u4f7f\u5f97\u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u975e\u5e38\u8f7b\u677e\u5730\u5f00\u59cb\u4f7f\u7528\u5b83\u3002\u4e8b\u5b9e\u4e0a\uff0c\u6211\u9047\u5230\u8fc7\u5b66\u4e60Python\u7684\u5c0f\u5b66\u751f!Python\u4e3a\u5f00\u53d1\u4eba\u5458\u63d0\u4f9b\u4e86\u4e00\u79cd\u9ad8\u7ea7\u7f16\u7a0b\u8bed\u8a00\uff0c\u53ef\u7528\u4e8e\u6784\u5efa\u7b80\u5355\u7684\u811a\u672c\uff0c\u6216\u8005\u53ef\u7528\u4e8e\u5f00\u53d1\u590d\u6742\u7684\u9762\u5411\u5bf9\u8c61\u7684\u4f53\u7cfb\u7ed3\u6784\uff0c\u8fd9\u4e9b\u4f53\u7cfb\u7ed3\u6784\u4f7f\u7528\u73b0\u4ee3\u8f6f\u4ef6\u9879\u76ee\u7684\u6240\u6709\u6700\u4f73\u5b9e\u8df5\u3002\u4e0eC\u76f8\u6bd4\uff0cPython\u8fd8\u63d0\u4f9b\u4e86\u5185\u7f6e\u673a\u5236\uff0c\u7528\u4e8e\u521b\u5efa\u7ebf\u7a0b\uff0c\u5904\u7406\u9519\u8bef\u5e76\u8f7b\u677e\u96c6\u6210\u5230\u6d4b\u8bd5<\/u>\u5de5\u5177\u4e2d\u3002<\/span><\/p>\n

\n\t\u53d8\u9769\u4e4b\u98ce\u6b63\u5728\u6211\u4eec\u8eab\u4e0a\uff0cMicroPython\u53ef\u80fd\u662f\u60a8\u7528\u6765\u6784\u5efa\u4e0b\u4e00\u4e2a\u4ea7\u54c1\u7684\u7f16\u7a0b\u8bed\u8a00\u3002\u5728\u672c\u8bfe\u7a0b\u4e2d\uff0c\u6211\u4eec\u5c06\u7814\u7a76\u5982\u4f55\u4f7f\u7528MicroPython\u5f00\u53d1\u4ea7\u54c1\u3002\u4e0e\u4f1a\u8005\u5c06\u8fdc\u79bb\u672c\u8bfe\u7a0b\uff0c\u8be6\u7ec6\u4e86\u89e3\u4ed6\u4eec\u9700\u8981\u505a\u4ec0\u4e48\u624d\u80fd\u5728\u4e0b\u4e00\u4e2a\u4ea7\u54c1\u4e2d\u4f7f\u7528MicroPython\u3002<\/p>\n

\n\t\u8fd9\u4e9b\u8bed\u8a00\u7279\u5f81\u7684\u6709\u8da3\u4e4b\u5904\u5728\u4e8e\u5b83\u4eec\u4f7f\u5f00\u53d1\u56e2\u961f\u7684\u6bcf\u4e2a\u6210\u5458\u90fd\u53ef\u4ee5\u6210\u4e3a\u7a0b\u5e8f\u5458!MicroPython\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u5e93\uff0c\u53ef\u4ee5\u63a7\u5236\u4f4e\u7ea7\u5fae\u63a7\u5236\u5668\u529f\u80fd\uff0c\u4ece\u800c\u6d88\u9664\u590d\u6742\u6027\u3002\u4f8b\u5982\uff0c\u786c\u4ef6\u5de5\u7a0b\u5e08\u53ef\u4ee5\u8bbe\u8ba1\u7535\u8def\u677f<\/u>\uff0c\u51e0\u4e4e\u4e0d\u77e5\u9053\u5fae\u63a7\u5236\u5668(\u6216C)\u7684\u5de5\u4f5c\u539f\u7406\uff0c\u5f00\u53d1\u53ef\u4ee5\u901a\u8fc7\u63a7\u5236GPI<\/u>O\u6d4b\u8bd5\u7535\u8def<\/u>\u677f\u7684\u9ad8\u7ea7\u811a\u672c\uff0c\u751a\u81f3\u53ef\u4ee5\u4e0eI2C<\/u>\u5668\u4ef6\u901a\u4fe1\u3002\u5728C\u4e2d\u5f00\u53d1I2C\u9a71\u52a8\u7a0b\u5e8f\u53ef\u80fd\u76f8\u5f53\u590d\u6742\uff0c\u4f46\u4f7f\u7528MicroPython\u53ea\u9700\u8981\u4ee5\u4e0b\u4ee3\u7801\u884c\u6765\u521b\u5efaI2C\u5bf9\u8c61\u5e76\u5c06\u6570\u636e\u53d1\u9001\u5230\u4ece\u5c5e\u8bbe\u5907\uff1a<\/p>\n

\n\t\u800c\u5df2!\u5904\u7406I2C\u7684\u6240\u6709\u57fa\u7840\u5de5\u4f5c\u90fd\u7531MicroPython\u5e93\u5904\u7406\uff0c\u8fd9\u5927\u5927\u7b80\u5316\u4e86\u5f00\u53d1\u3002(\u770b\u770b\u6211\u5728C\u4e2d\u7684\u4e00\u4e2aI2C\u9a71\u52a8\u7a0b\u5e8f\u663e\u793a\u4e86\u51e0\u5343\u884c\u4ee3\u7801\uff0c\u6388\u4e88\u5b83\u662f\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u7684\u5b9e\u73b0\uff0c\u5e76\u63d0\u4f9b\u4e86\u4e00\u4e9b\u529f\u80fd\uff0c\u4e00\u65e6\u5960\u5b9a\u4e86\u57fa\u7840\u5de5\u4f5c\uff0c\u5c31\u53ef\u4ee5\u4e0e\u603b\u7ebf\u4ea4\u4e92)\u3002<\/p>\n

\n\t\"\u5229\u7528MicroPython\u8bbe\u8ba1\u5d4c\u5165\u5f0f\u7cfb\u7edf\u7684\u4f18\u7f3a\u70b9\"<\/p>\n

\n\t\u5728\u8003\u8651\u4f7f\u7528MicroPython\u8fdb\u884c\u4ea7\u54c1\u5f00\u53d1\u65f6\uff0c\u5f00\u53d1\u4eba\u5458\u9700\u8981\u8003\u8651\u51e0\u4e2a\u5173\u952e\u56e0\u7d20\u3002\u9996\u5148\uff0c\u5f00\u53d1\u4eba\u5458\u9700\u8981\u8003\u8651\u5982\u4f55\u4fdd\u62a4\u4ed6\u4eec\u7684\u5e94\u7528\u7a0b\u5e8f\u4ee3\u7801\u3002MicroPython\u5141\u8bb8\u5f00\u53d1\u4eba\u5458\u52a0\u8f7d\u57fa\u4e8e\u4ee3\u7801\u6587\u672c\u7684Python\u811a\u672c\u6216\u5c06\u8fd9\u4e9b\u811a\u672c\u7f16\u8bd1\u4e3a\u5b57\u8282\u7801\u5e76\u5c06\u5b83\u4eec\u653e\u5165a.mpy\u6a21\u5757\u4e2d\u3002\u8fd9\u4e9b\u89e3\u51b3\u65b9\u6848\u7684\u95ee\u9898\u5728\u4e8e\uff0c\u4efb\u4f55\u80fd\u591f\u8bbf\u95eeMicroPython\u6587\u4ef6\u7cfb\u7edf\u7684\u4eba\u90fd\u53ef\u4ee5\u8f7b\u677e\u83b7\u5f97\u5e94\u7528\u7a0b\u5e8f\u4ee3\u7801\uff0c\u8fd9\u5f88\u5bb9\u6613\u5b9e\u73b0\u3002\u5b57\u8282\u7801\u786e\u5b9e\u4f7f\u5b83\u66f4\u96be\u4e00\u70b9\uff0c\u4f46\u5c06\u5b57\u8282\u4ee3\u7801\u8f6c\u6362\u56de\u53ef\u8bfb\u4ee3\u7801\u5e76\u4e0d\u56f0\u96be\u3002\u5f00\u53d1\u4eba\u5458\u9700\u8981\u8003\u8651\u4ed6\u4eec\u9700\u8981\u7cfb\u7edf\u7684\u5b89\u5168\u6027\uff0c\u5e76\u53ef\u80fd\u91c7\u53d6\u989d\u5916\u63aa\u65bd\u6765\u4fdd\u62a4\u77e5\u8bc6\u4ea7\u6743\u3002<\/span><\/p>\n

\n\t\u63a5\u4e0b\u6765\uff0c\u5f00\u53d1\u4eba\u5458\u9700\u8981\u8003\u8651\u5982\u679c\u51fa\u73b0\u95ee\u9898\u4ed6\u4eec\u5c06\u5982\u4f55\u6062\u590d\u4ed6\u4eec\u7684\u7cfb\u7edf\u3002\u6839\u636e\u6240\u9009\u7684\u5fae\u63a7\u5236\u5668\uff0c\u5b83\u4eec\u7684\u5e94\u7528\u7a0b\u5e8f\u4ee3\u7801\u53ef\u4ee5\u5728MCU<\/u>\u5185\u90e8\uff0c\u4e5f\u53ef\u4ee5\u5728\u5916\u90e8\u5b58\u50a8<\/u>\u8bbe\u5907(\u5982SD\u5361)\u4e0a\u3002\u6211\u53d1\u73b0\u6587\u4ef6\u7cfb\u7edf\u5728\u7535\u6e90\u5faa\u73af\u6216\u6b20\u538b\u6761\u4ef6\u4e0b\u4e0d\u662f\u5f88\u5f3a\u5927\u3002\u5982\u679c\u6587\u4ef6\u7cfb\u7edf\u635f\u574f\uff0cMicroPython\u5c06\u901a\u8fc7\u5c06\u9ed8\u8ba4\u6620\u50cf\u590d\u5236\u56de\u6587\u4ef6\u7cfb\u7edf\u6765\u6062\u590d\u5b83\u3002\u5f00\u53d1\u4eba\u5458\u9700\u8981\u786e\u4fdd\u5c06\u5176\u9ed8\u8ba4\u4ee3\u7801\u96c6\u6210\u5230\u5176\u5185\u6838\u7248\u672c\u4e2d\uff0c\u4ee5\u4fbf\u5728\u51fa\u73b0\u95ee\u9898\u65f6\uff0c\u81f3\u5c11\u5c06\u5176\u6062\u590d\u4e3a\u51fa\u5382\u9ed8\u8ba4\u8bbe\u7f6e\uff0c\u7136\u540e\u53ef\u4ee5\u4ece\u8bbe\u5907\u4e0a\u53ef\u80fd\u5b58\u5728\u7684\u5176\u4ed6\u5185\u5b58\u4f4d\u7f6e\u6062\u590d\u4efb\u4f55\u66f4\u65b0\u3002<\/p>\n

\n\t\u6700\u540e\uff0c\u5f00\u53d1\u4eba\u5458\u53ef\u80fd\u5e0c\u671b\u786e\u4fdd\u4ed6\u4eec\u6709\u591a\u4e2a\u5185\u5b58\u8bbe\u5907\u53ef\u4f9b\u9009\u62e9\u3002\u65b0\u7684\u65d7\u8230MicroPython\u5f00\u53d1\u677f\uff0cpyboard D\u7cfb\u5217\uff0c\u5305\u62ec\u4e24\u4e2a\u72ec\u7acb\u7684SPI\u5185\u5b58\u8bbe\u5907\uff0c\u6bcf\u4e2a2 MB\u3002\u4e00\u4e2a\u7528\u4e8e\u5b58\u50a8\u5e94\u7528\u7a0b\u5e8f\u4ee3\u7801\uff0c\u53e6\u4e00\u4e2a\u7528\u4e8e\u5b58\u50a8\u6570\u636e\u6216\u5176\u4ed6\u4fe1\u606f\u3002\u751f\u4ea7\u7cfb\u7edf\u5e94\u8be5\u505a\u7c7b\u4f3c\u7684\u4e8b\u60c5\uff0c\u751a\u81f3\u4fdd\u7559\u56fa\u4ef6\u5907\u4efd\u526f\u672c\uff0c\u4ee5\u4fbf\u5728\u51fa\u73b0\u95ee\u9898\u65f6\uff0c\u53ef\u4ee5\u6062\u590d\u5e94\u7528\u7a0b\u5e8f\u800c\u4e0d\u4f1a\u7ed9\u7528\u6237\u5e26\u6765\u4efb\u4f55\u95ee\u9898\u3002<\/p>\n

\n\t\u4f7f\u7528MicroPython\u8fdb\u884c\u4ea7\u54c1\u8bbe\u8ba1\u542c\u8d77\u6765\u5f88\u6709\u8da3\uff0c\u6709\u6ca1\u6709\u4eba\u771f\u6b63\u7528\u5b83\u6765\u5f00\u53d1\u5546\u4e1a\u4ea7\u54c1?\u636e\u6211\u6240\u77e5\uff0cMicroPython\u5df2\u88ab\u7528\u4e8e\u591a\u79cd\u4ea7\u54c1\u4e2d\uff0c\u6beb\u65e0\u7591\u95ee\uff0c\u6211\u4e0d\u77e5\u9053\u66f4\u591a\u3002\u4f8b\u5982\uff0cMicroPython\u5df2\u88ab\u7528\u4e8e\u5c0f\u578b\u536b\u661f\u4e2d\uff0c\u7528\u4e8e\u7535\u5b50\u7535\u6e90\u548c\u6570\u636e\u91c7\u96c6<\/u>\u7cfb\u7edf(\u5176\u4e2d\u4e00\u4e9b\u6211\u4eb2\u81ea\u53c2\u4e0e\u8fc7)\u3002\u5728\u6b27\u6d32\u822a\u5929\u5c40\u4e5f\u5df2\u7ecf\u5728\u66f4\u5927\u7684\u536b\u661f\u7cfb\u7edf\u4f7f\u7528MicroPython\u8c03\u67e5\u3002MicroPython\u8fd8\u7528\u4e8e\u6d41\u884c\u7684OpenMV\u6a21\u5757\uff0c\u8be5\u6a21\u5757\u5141\u8bb8\u5f00\u53d1\u4eba\u5458\u521b\u5efa\u673a\u5668\u89c6\u89c9<\/u>\u5e94\u7528\u7a0b\u5e8f\u3002\u8be5\u6a21\u5757\u8fd0\u884cMicroPython\uff0c\u5141\u8bb8\u5f00\u53d1\u4eba\u5458\u901a\u8fc7\u4ea4\u4e92\u5f0fIDE\u521b\u5efa\u811a\u672c\uff0c\u7136\u540e\u5c06\u5f00\u53d1\u4eba\u5458\u7684\u811a\u672c\u4e0b\u8f7d\u5230\u6a21\u5757\u3002\u5f00\u53d1\u4eba\u5458\u751a\u81f3\u53ef\u4ee5\u8bad\u7ec3\u673a\u5668\u5b66\u4e60<\/u>\u6a21\u578b\u5e76\u5c06\u5176\u8f6c\u6362\u4e3a\u5728OpenMV\u6a21\u5757\u4e0a\u8fd0\u884c!\u8fd9\u8868\u660eMicroPython\u53ef\u7528\u4e8e\u8fd0\u884c\u4e0d\u4ec5\u4ec5\u662f\u7b80\u5355\u7684\u7b97\u6cd5\u6216\u5207\u6362\u4e00\u4e9bI \/ O.<\/span><\/p>\n

\n\t\u4f7f\u7528MicroPython\u6784\u5efa\u5d4c\u5165\u5f0f\u4ea7\u54c1\u65e0\u6cd5\u6ee1\u8db3\u6bcf\u4e2a\u5f00\u53d1\u56e2\u961f\u7684\u9700\u6c42\uff0c\u5982C \/ C ++\uff0c\u4f46\u5b83\u4e3a\u5f00\u53d1\u4eba\u5458\u63d0\u4f9b\u4e86\u4e00\u4e2a\u6709\u8da3\u7684\u5feb\u901f\u539f\u578b\u8bbe\u8ba1\u6216\u5f00\u53d1\u5546\u4e1a\u4ea7\u54c1\u7684\u89e3\u51b3\u65b9\u6848\u3002\u5f53\u7136\u8fd8\u5b58\u5728\u4e00\u4e9b\u6311\u6218\uff0c\u4f8b\u5982\u4fdd\u62a4\u57fa\u4e8eMicroPython\u7684\u7cfb\u7edf\u5e76\u786e\u4fdd\u786e\u5b9a\u6027\u884c\u4e3a\u3002\u8fd9\u4e9b\u6311\u6218\u53ef\u4ee5\u901a\u8fc7\u9002\u5f53\u7684\u5e94\u7528\u8bbe\u8ba1\u9884\u5148\u514b\u670d\u3002MicroPython\u7684\u6613\u7528\u6027\u548cPython\u7684\u666e\u53ca\u4f7f\u5f97\u4f7f\u7528MicroPython\u6784\u5efa\u5d4c\u5165\u5f0f\u7cfb\u7edf\u6210\u4e3a\u4e00\u4e2a\u6709\u8da3\u7684\u673a\u4f1a\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"

C \/ C ++\u7f16\u7a0b\u8bed\u8a00\u957f\u671f\u4ee5\u6765\u4e00\u76f4\u4e3b\u5bfc\u7740\u5d4c\u5165\u5f0f\u7cfb\u7edf\u884c\u4e1a\uff0c\u5f88\u5c11\u6709\u5176\u4ed6\u8bed\u8a00\u53ef\u4ee5\u627e\u5230\u7acb\u8db3\u70b9\u3002\u867d\u7136 Java \u548cAda\u7b49\u8bed\u8a00\u5df2\u7ecf\u5c1d\u8bd5\u8fc7\uff0c\u4f46 Python \u7684\u6d41\u884c\u7a0b\u5ea6\u4e0d\u4ec5\u5728\u4e0d\u65ad\u63d0\u9ad8\uff0c\u800c\u4e14\u5df2\u7ecf\u5728\u57fa\u4e8e Linux \u7684<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"_links":{"self":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2634"}],"collection":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2634"}],"version-history":[{"count":0,"href":"http:\/\/www.szryc.com\/index.php?rest_route=\/wp\/v2\/posts\/2634\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2634"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2634"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.szryc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2634"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}