{"id":1964,"date":"2025-10-28T13:45:50","date_gmt":"2025-10-28T05:45:50","guid":{"rendered":"https:\/\/xujiwei.com\/blog\/?p=1964"},"modified":"2025-10-29T19:51:48","modified_gmt":"2025-10-29T11:51:48","slug":"arduinobasic-on-esp32","status":"publish","type":"post","link":"https:\/\/xujiwei.com\/blog\/2025\/10\/arduinobasic-on-esp32\/","title":{"rendered":"\u7528 ESP32-S3 \u8dd1 BASIC \u89e3\u91ca\u5668\uff0c\u8fd9\u6bd4\u5f53\u5e74\u6bd4\u5c14\u76d6\u8328\u7528\u7684\u7535\u8111\u914d\u7f6e\u9ad8\u591a\u4e86"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_65 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<p class=\"ez-toc-title\">\u6587\u7ae0\u76ee\u5f55<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69f1970d29d21\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69f1970d29d21\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/xujiwei.com\/blog\/2025\/10\/arduinobasic-on-esp32\/#%E6%9D%A5%E8%B7%91%E4%B8%AA_1_%E5%8A%A0%E5%88%B0_100\" title=\"\u6765\u8dd1\u4e2a 1 \u52a0\u5230 100\">\u6765\u8dd1\u4e2a 1 \u52a0\u5230 100<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/xujiwei.com\/blog\/2025\/10\/arduinobasic-on-esp32\/#ArduinoBASIC_%E9%A1%B9%E7%9B%AE\" title=\"ArduinoBASIC \u9879\u76ee\">ArduinoBASIC \u9879\u76ee<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/xujiwei.com\/blog\/2025\/10\/arduinobasic-on-esp32\/#%E7%A1%AC%E4%BB%B6%E6%93%8D%E4%BD%9C_PIN%E3%80%81PINMODE\" title=\"\u786c\u4ef6\u64cd\u4f5c PIN\u3001PINMODE\">\u786c\u4ef6\u64cd\u4f5c PIN\u3001PINMODE<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/xujiwei.com\/blog\/2025\/10\/arduinobasic-on-esp32\/#%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99\" title=\"\u53c2\u8003\u8d44\u6599\">\u53c2\u8003\u8d44\u6599<\/a><\/li><\/ul><\/nav><\/div>\n<p>\u4e4b\u524d\u6211\u505a\u4e86\u4e2a AI \u751f\u6210\u5916\u5f62\u7684\u590d\u53e4\u5c0f\u7535\u8111\uff0c\u5e76\u4e14\u540c\u6837\u4f7f\u7528 AI \u751f\u6210\u4e86 3D \u6a21\u578b\uff0c\u585e\u4e86 ESP32-S3 \u5f00\u53d1\u677f + 0.96 \u82f1\u5bf8 OLED \u8fdb\u53bb\uff0c\u987a\u624b\u505a\u4e86\u4e2a\u80fd\u64ad\u653e\u300aBad Apple\u300b\u7684\u56fa\u4ef6\uff08\u89c1\u300a<a href=\"https:\/\/mp.weixin.qq.com\/s\/mu1q-CiXpZABE8_FYRR9NA\">3 \u6b65\u4ece nana banana AI \u751f\u6210\u7684\u590d\u53e4\u5c0f\u7535\u8111\u5230\u771f\u5b9e\u684c\u9762\u5c0f\u73a9\u5177<\/a>\u300b\uff09\u3002<\/p>\n<p><img src=\"https:\/\/xujiwei.com\/blog\/wp-content\/uploads\/2025\/10\/esp32-s3-arduinobasic-2.jpg\" alt=\"esp32-s3-arduinobasic-2\" \/><\/p>\n<p>\u6700\u8fd1\u5728 GitHub \u4e0a\u770b\u5230\u4e00\u4e2a <strong>ArduinoBASIC<\/strong> \u9879\u76ee\uff0c\u4e00\u4e2a\u8fd8\u7b97\u5b8c\u6574\u7684 BASIC \u8bed\u8a00\u89e3\u91ca\u5668\uff0c\u652f\u6301 BASIC \u8bed\u8a00\u4e2d\u5e38\u7528\u7684\u7279\u6027\uff0c\u8fd9\u4e0d\u521a\u597d\u7528\u6765\u628a\u8fd9\u4e2a\u590d\u53e4\u5c0f\u7535\u8111\u53d8\u6210\u771f\u7684\u53ef\u4ee5<strong>\u5199\u4ee3\u7801\u7684\u5c0f\u7535\u8111<\/strong>\u5417 \ud83d\ude03\u3002<\/p>\n<blockquote>\n<p>PS. \u5f53\u5e74\u6bd4\u5c14\u00b7\u76d6\u8328\u548c\u4fdd\u7f57\u00b7\u827e\u4f26\u4e3a <strong>Altair 8800<\/strong> \u5199 BASIC \u65f6\uff0c\u673a\u5668 CPU \u662f <strong>2 MHz<\/strong> \u7684 Intel 8080\uff0c\u53ea\u6709 <strong>4 KB<\/strong> RAM\u3002\u5bf9\u6bd4\u4e4b\u4e0b\uff0cESP32-S3 \u7684\u6027\u80fd\u5f3a\u592a\u591a\u4e86\u3002<\/p>\n<\/blockquote>\n<h2><span class=\"ez-toc-section\" id=\"%E6%9D%A5%E8%B7%91%E4%B8%AA_1_%E5%8A%A0%E5%88%B0_100\"><\/span>\u6765\u8dd1\u4e2a 1 \u52a0\u5230 100<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>ArduinoBASIC \u5728 ESP32-S3 \u4e0a\uff0c\u5b9e\u9645\u8ba1\u7b97\u8fc7\u7a0b\u8fd8\u662f\u6bd4\u8f83\u5feb\u7684\uff0c\u5982\u679c\u4e0d\u8f93\u51fa\u4e2d\u95f4\u8fc7\u7a0b\uff0c\u51e0\u4e4e\u76f8\u5f53\u4e8e\u77ac\u95f4\u51fa\u7ed3\u679c\uff0c\u4f46\u662f\u4f30\u8ba1\u539f\u6765\u9879\u76ee\u4e2d\u5199\u5c4f\u76f8\u5173\u7684\u4ee3\u7801\u6ca1\u6709\u7279\u522b\u4f18\u5316\u6027\u80fd\uff0c\u5bfc\u81f4\u6709\u5c4f\u5e55\u8f93\u51fa\u7684\u65f6\u5019\uff0c\u6027\u80fd\u4e0b\u964d\u5f97\u5389\u5bb3\u3002<\/p>\n<p>PS. \u624b\u673a\u62cd\u6444\u7684\u65f6\u5019\u7531\u4e8e\u5237\u65b0\u7387\u548c\u5feb\u95e8\u65f6\u95f4\u7684\u5173\u7cfb\uff0c\u663e\u793a\u5c4f\u6709\u79cd\u8001 CRT \u663e\u793a\u5668\u7684\u611f\u89c9\u4e86 \ud83d\ude48\u3002<\/p>\n<p><strong>\u6d4b\u8bd5\u4ee3\u7801<\/strong><\/p>\n<pre><code class=\"language-basic\">10 sum=0\n20 FOR i = 1 TO 100\n30 sum=sum+i\n40 PRINT &quot;1+..&quot;;i;&quot;=&quot;;sum\n50 NEXT i<\/code><\/pre>\n<p><strong>\u89c6\u9891<\/strong><\/p>\n<h2><span class=\"ez-toc-section\" id=\"ArduinoBASIC_%E9%A1%B9%E7%9B%AE\"><\/span>ArduinoBASIC \u9879\u76ee<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u9879\u76ee\u5730\u5740\uff1a<a href=\"https:\/\/github.com\/robinhedwards\/ArduinoBASIC\">https:\/\/github.com\/robinhedwards\/ArduinoBASIC<\/a><\/p>\n<p>\u9879\u76ee\u4ecb\u7ecd\uff1a<\/p>\n<p>A complete BASIC interpreter for the Arduino, using a PS\/2 keyboard, and SPI OLED screen. The BASIC supports almost all the usual features, with float and string variables, multi-dimensional arrays, FOR-NEXT, GOSUB-RETURN, etc.<\/p>\n<p><img src=\"https:\/\/xujiwei.com\/blog\/wp-content\/uploads\/2025\/10\/esp32-s3-arduinobasic-3.jpg\" alt=\"esp32-s3-arduinobasic-3\" \/><\/p>\n<p>\u539f\u4f5c\u8005\u662f\u7528\u4e86 PS\/2 \u952e\u76d8\u3001SPI \u63a5\u53e3\u7684 0.96 \u5bf8 OLED \u5c4f\u5e55\uff0c\u5e76\u4e14\u662f\u7528 EEPROM \u6765\u4fdd\u5b58\u7528\u6237\u7a0b\u5e8f\uff0c\u53ef\u80fd\u662f\u56e0\u4e3a\u4f5c\u8005\u5199\u8fd9\u4e2a\u975e\u5e38\u4e45\u8fdc\u4e86\uff0c10 \u5e74\u524d\u7684\u9879\u76ee\uff0c\u53e6\u5916\u5c31\u662f\u57fa\u4e8e Arduino UNO \u4e4b\u7c7b\u7684\u5f00\u53d1\u677f\uff0c\u672c\u8eab\u8d44\u6e90\u76f8\u5f53\u6709\u9650\u3002<\/p>\n<p>\u6211 clone \u4e0b\u6765\u4e4b\u540e\uff0c\u76f4\u63a5\u4e00\u53e5\u8bdd\u8ba9 AI \u628a\u5b83\u8f6c\u6362\u6210\u4e86\u57fa\u4e8e ESP32-S3 + Arduino \u7684\u9879\u76ee\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u4f7f\u7528 I2C \u7684 OLED \u548c USB \u952e\u76d8\u4e86\uff0c\u6bd5\u7adf ESP32-S3 \u76f4\u63a5\u652f\u6301 USB Host\u3002<\/p>\n<p><strong>\u4e0d\u5f97\u4e0d\u8bf4\u5728\u5199\u8fd9\u79cd\u4ee3\u7801\u7684\u80fd\u529b\u4e0a\uff0cAI \u8fd8\u662f\u76f8\u5f53\u597d\u7528\u7684\uff0c\u505a\u4e2a\u79fb\u690d\u4ec0\u4e48\u7684\u5de5\u4f5c\uff0c\u501f\u52a9\u4e8e AI\uff0c\u53ef\u4ee5\u6781\u5927\u5730\u63d0\u5347\u6548\u7387\u3002<\/strong><\/p>\n<p>\u53e6\u5916\u56e0\u4e3a ESP32-S3-Zero \u5f00\u53d1\u677f\u7684 USB Type-C \u63a5\u53e3\u7528\u4e8e\u8fde\u63a5\u952e\u76d8\uff0c\u6240\u4ee5\u9700\u8981\u989d\u5916\u4e00\u4e2a\u8f6c\u63a5\u677f\uff0c\u6dfb\u52a0\u4e00\u4e2a USB Type-C \u63a5\u53e3\u6765\u4f9b\u7535\uff0c\u4e0d\u8fc7\u8fd9\u4e2a\u5728\u4e4b\u524d\u505a\u590d\u53e4\u5c0f\u7535\u8111\u7684\u65f6\u5019\u5df2\u7ecf\u8003\u8651\u8fc7\u4e86\uff0c\u8fd9\u91cc\u5c31\u76f4\u63a5\u7528\u4e86\u3002<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E7%A1%AC%E4%BB%B6%E6%93%8D%E4%BD%9C_PIN%E3%80%81PINMODE\"><\/span>\u786c\u4ef6\u64cd\u4f5c PIN\u3001PINMODE<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u8fd9\u4e2a ArduinoBASIC \u9879\u76ee\u4e2d\uff0c\u8fd8\u6709\u589e\u52a0\u4ee5\u4e0b\u51e0\u4e2a\u5bf9 GPIO \u64cd\u4f5c\u7684\u51fd\u6570\uff1a<\/p>\n<ul>\n<li>PIN pinNum, value (0 = low, non-zero = high)<\/li>\n<li>PINMODE pinNum, mode ( 0 = input, 1 = output)<\/li>\n<li>PINREAD(pin) - see Arduino digitalRead()<\/li>\n<li>ANALOGRD(pin) - see Arduino analogRead()<\/li>\n<\/ul>\n<p>\u7406\u8bba\u4e0a\u901a\u8fc7\u8fd9\u51e0\u4e2a\u51fd\u6570\uff0c\u4e5f\u53ef\u4ee5\u5b9e\u73b0\u4e00\u4e9b\u7b80\u5355\u7684\u786c\u4ef6\u64cd\u4f5c\u80fd\u529b\uff0c\u8bfb\u53d6\u4e2a\u4f20\u611f\u5668\u4ec0\u4e48\u7684\uff1f\u6216\u8005\u81f3\u5c11\u53ef\u4ee5\u63a7\u5236 LED \u6765\u5b9e\u73b0\u4e2a\u6d41\u6c34\u706f\u5427\uff5e<\/p>\n<p>\u4e0d\u8fc7\u6211\u4e4b\u524d\u753b\u7684\u8f6c\u63a5\u677f\u5e76\u6ca1\u6709\u9884\u7559\u8fd9\u4e9b\u63a5\u53e3\uff0c\u5c31\u61d2\u5f97\u5199\u4ee3\u7801\u73a9\u4e86\uff0c\u4e0d\u8fc7\u4e4b\u524d\u662f\u6d4b\u8bd5\u4e86 GPIO \u6765\u63a7\u5236 LED \u662f\u6ca1\u6709\u95ee\u9898\u7684\u3002<\/p>\n<p>\u5c31\u8fd9\u6837\u5427\uff0c\u684c\u4e0a\u7ee7\u7eed\u591a\u4e00\u4e2a\u5403\u7070\u7684\u5c0f\u73a9\u5177\u4e86\uff5e<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%8F%82%E8%80%83%E8%B5%84%E6%96%99\"><\/span>\u53c2\u8003\u8d44\u6599<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Altair_8800\">https:\/\/en.wikipedia.org\/wiki\/Altair_8800<\/a><\/li>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Altair_BASIC\">https:\/\/en.wikipedia.org\/wiki\/Altair_BASIC<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/robinhedwards\/ArduinoBASIC\">https:\/\/github.com\/robinhedwards\/ArduinoBASIC<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4e4b\u524d\u6211\u505a\u4e86\u4e2a AI \u751f\u6210\u5916\u5f62\u7684\u590d\u53e4\u5c0f\u7535\u8111\uff0c\u5e76\u4e14\u540c\u6837\u4f7f\u7528 AI \u751f\u6210\u4e86 3D \u6a21\u578b &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/xujiwei.com\/blog\/2025\/10\/arduinobasic-on-esp32\/\">\u7ee7\u7eed\u9605\u8bfb &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":1960,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[402],"tags":[491,492,328,386],"_links":{"self":[{"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/posts\/1964"}],"collection":[{"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/comments?post=1964"}],"version-history":[{"count":0,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/posts\/1964\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/media\/1960"}],"wp:attachment":[{"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/media?parent=1964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/categories?post=1964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xujiwei.com\/blog\/wp-json\/wp\/v2\/tags?post=1964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}