{"id":6866,"date":"2019-05-16T16:10:30","date_gmt":"2019-05-16T07:10:30","guid":{"rendered":"https:\/\/techclass.wfjydl.com\/?p=6866"},"modified":"2022-11-15T16:34:28","modified_gmt":"2022-11-15T08:34:28","slug":"%e4%bd%bf%e7%94%a8arduino%e9%a9%b1%e5%8a%a8lcd%e7%9a%84diy%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/techclass.wfjydl.com\/knowledge\/deviceplus\/how-tos\/arduino\/diy-guide-to-setting-up-an-lcd-with-arduino","title":{"rendered":"\u4f7f\u7528Arduino\u9a71\u52a8LCD\u7684DIY\u6307\u5357"},"content":{"rendered":"<div class=\u201cthe_content_wrapper\u201d>\n\u8fd9\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e<a href=\"https:\/\/www.deviceplus.com\/\">DevicePlus.com<\/a>\u82f1\u8bed\u7f51\u7ad9\u7684\u7ffb\u8bd1\u7a3f\u3002<\/p>\n<h2>\u5229\u7528Arduino\u9a71\u52a8LCD\u663e\u793a\u5c4f<\/h2>\n<p>&nbsp;<\/p>\n<p><strong>\u76ee\u7684<\/strong><\/p>\n<p>\u672c\u6559\u7a0b\u63cf\u8ff0\u4e86\u5982\u4f55\u4f7f\u7528Arduino\u9a71\u52a8LCD\u663e\u793a\u5c4f\u3002<\/p>\n<p><strong>\u6982\u8ff0<\/strong><\/p>\n<p>Arduino\u5f00\u53d1\u677f\u5c5e\u4e8e\u975e\u5e38\u6d41\u884c\u7684\u5355\u7247\u673a\u5f00\u53d1\u677f\uff0c\u8be5\u677f\u7684\u4e00\u4e2a\u5e38\u7528\u529f\u80fd\u5c31\u662f\u7528\u9a71\u52a8LCD\u5c4f\uff0c\u901a\u5e38\u7528\u6765\u5c06\u4fe1\u606f\u4f20\u9012\u7ed9\u7528\u6237\u3002\u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u6211\u5c06\u6559\u60a8\u5982\u4f55\u4f7f\u7528Arduino\u5355\u7247\u673a\u5f00\u53d1\u677f\u548cAdafruit I2C\/SPI LCD\u9a71\u52a8\u6a21\u5757\u6765\u9a71\u52a8LCD\u3002<\/p>\n<p><strong>\u8bbe\u5907<\/strong><\/p>\n<ol>\n<li><strong>Arduino Uno R3<\/strong> &#8211; <a href=\"https:\/\/www.adafruit.com\/product\/50\">https:\/\/www.adafruit.com\/product\/50<\/a><\/li>\n<li><strong>I2C\/SPI LCD \u9a71\u52a8\u6a21\u5757<\/strong> &#8211; <a href=\"https:\/\/www.adafruit.com\/product\/292\">https:\/\/www.adafruit.com\/product\/292<\/a><\/li>\n<li><strong>RGB LCD 20&#215;4<\/strong> &#8211; <a href=\"https:\/\/www.adafruit.com\/product\/499\">https:\/\/www.adafruit.com\/product\/499<\/a><\/li>\n<li><strong>9V, 1A \u7535\u6e90\u9002\u914d\u5668<\/strong> &#8211; <a href=\"https:\/\/www.adafruit.com\/product\/63\">https:\/\/www.adafruit.com\/product\/63<\/a><\/li>\n<li><strong>\u8df3\u7ebf<\/strong> &#8211; <a href=\"https:\/\/www.amazon.com\/GenBasic-Female-Solderless-Breadboard-Prototyping\/dp\/B01MS9GY7W\/ref=sr_1_1_sspa?s=electronics&amp;ie=UTF8&amp;qid=1515705634&amp;sr=1-1-spons&amp;keywords=jumper+wires&amp;psc=1\">https:\/\/www.amazon.com\/GenBasic-Female-Solderless-Breadboard-Prototyping\/dp\/B01MS9GY7W\/ref=sr_1_1_sspa?s=electronics&amp;ie=UTF8&amp;qid=1515705634&amp;sr=1-1-spons&amp;keywords=jumper+wires&amp;psc=1<\/a><\/li>\n<li><strong>USB \u7535\u7f06 (A-to-B)<\/strong> &#8211; <a href=\"https:\/\/www.amazon.com\/AmazonBasics-USB-2-0-Cable-Male\/dp\/B00NH11KIK\">https:\/\/www.amazon.com\/AmazonBasics-USB-2-0-Cable-Male\/dp\/B00NH11KIK<\/a><\/li>\n<li><strong>\u9762\u5305\u677f<\/strong> &#8211; <a href=\"https:\/\/www.amazon.com\/Elegoo-Breadboard-Solderless-Distribution-Connecting\/dp\/B01EV6LJ7G\/ref=sr_1_1_sspa?s=electronics&amp;ie=UTF8&amp;qid=1515707694&amp;sr=1-1-spons&amp;keywords=breadboard&amp;psc=1\"> https:\/\/www.amazon.com\/Elegoo-Breadboard-Solderless-Distribution-Connecting\/dp\/B01EV6LJ7G\/ref=sr_1_1_sspa?s=electronics&amp;ie=UTF8&amp;qid=1515707694&amp;sr=1-1-spons&amp;keywords=breadboard&amp;psc=1<\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p><b>\u76ee\u5f55<\/b><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u7535\u8def\u63a5\u7ebf<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u7f16\u5199\u4ee3\u7801<\/span>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u914d\u7f6e<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u8bbe\u7f6e<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u5faa\u73af<\/span><\/li>\n<\/ol>\n<\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">\u4e0a\u4f20\u5e76\u8fd0\u884c\u7a0b\u5e8f<\/span><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p><strong>\u7a0b\u5e8f<\/strong><\/p>\n<h2>1. \u7535\u8def\u63a5\u7ebf<\/h2>\n<p>LCD\u901a\u5e38\u9700\u8981\u8fde\u63a5\u5f88\u591a\u7ebf\u624d\u80fd\u5de5\u4f5c\u3002\u968f\u65f6\u7ba1\u7406\u6240\u6709\u8fd9\u4e9b\u8fde\u63a5\u53ef\u80fd\u65e2\u7e41\u7410\u53c8\u70e6\u4eba\u3002\u5e78\u8fd0\u7684\u662f\uff0cAdafruit\u5236\u9020\u4e86\u4e00\u6b3e\u53ef\u517c\u5bb9\u5927\u591a\u6570LCD\u7684I2C\/SPI LCD\u9a71\u52a8\u6a21\u5757\u3002\u8be5\u9a71\u52a8\u6a21\u5757\u53ef\u65b9\u4fbf\u5730\u5c06\u60a8\u7684\u5355\u7247\u673a\u548cLCD\u4e4b\u95f4\u7684\u8fde\u63a5\u6570\u91cf\u51cf\u5c11\u52304\u4e2a\u3002<\/p>\n<p>\u6211\u603b\u662f\u559c\u6b22\u7528Fritzing\u7ed8\u5236\u63a5\u7ebf\u56fe\uff08\u56fe1\uff1aArduino-LCD\u539f\u7406\u56fe\uff09\u3002Fritzing\u662f\u4e00\u6b3e\u5f00\u6e90\u539f\u7406\u56fe\u8bbe\u8ba1\u548cPCB\u5e03\u7ebf\u8f6f\u4ef6\u3002Fritzing\u7684\u4e0b\u8f7d\u5730\u5740\uff08\u53ef\u9009\uff09\u5982\u4e0b\uff1a<a href=\"https:\/\/fritzing.org\/home\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/fritzing.org\/home\/<\/a><\/p>\n<div id=\"attachment_7071\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7071\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig1-Arduino-LCD-Schematic-1.png\" alt=\"\u4f7f\u7528Arduino\u9a71\u52a8LCD\u7684DIY\u6307\u5357 Arduino-LCD\u539f\u7406\u56fe\" width=\"500\" height=\"793\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig1-Arduino-LCD-Schematic-1.png 500w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig1-Arduino-LCD-Schematic-1-189x300.png 189w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig1-Arduino-LCD-Schematic-1-92x146.png 92w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig1-Arduino-LCD-Schematic-1-32x50.png 32w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig1-Arduino-LCD-Schematic-1-47x75.png 47w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p>\n<p class=\"wp-caption-text\">\u56fe1\uff1aArduino-LCD\u539f\u7406\u56fe<\/p>\n<\/div>\n<p>LCD\u4e0a\u7684\u5f15\u811a1\u8fde\u81f3LCD\u9a71\u52a8\u6a21\u5757\u4e0a\u7684\u5f15\u811a1\u3002\u5176\u4f59\u5f15\u811a\u6309\u987a\u5e8f\u8fde\u63a5\u3002\u8fd9\u53ef\u4ee5\u5728\u9762\u5305\u677f\u4e0a\u5b8c\u6210\uff0c\u4e5f\u53ef\u4ee5\u5c06\u9a71\u52a8\u6a21\u5757\u710a\u63a5\u5230LCD\u4e0a\uff0c\u6b63\u5982\u6211\u6240\u505a\u7684\u8fd9\u6837\u3002<\/p>\n<p>I2C\u548cSPI\u662f\u4e24\u79cd\u975e\u5e38\u6d41\u884c\u7684\u4e32\u884c\u63a5\u53e3\u603b\u7ebf\u3002\u672c\u6559\u7a0b\u5c06\u4ecb\u7ecd\u4f7f\u7528I2C\u8fde\u63a5Arduino\u548cLCD\u9a71\u52a8\u6a21\u5757\uff0c\u4f46\u662fLCD\u9a71\u52a8\u6a21\u5757\u4e5f\u53ef\u4ee5\u8fde\u63a5SPI\u63a5\u53e3\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u8df3\u63a5\u9a71\u52a8\u6a21\u5757\u4e0a\u7684\u710a\u63a5\u8df3\u7ebf\uff08\u56fe2\uff1aLCD\u9a71\u52a8\u6a21\u5757\u4e0a\u7684\u710a\u63a5\u8df3\u7ebf\uff09\u6765\u8bbe\u7f6eI2C\u5730\u5740\uff08A0\u3001A1\u3001A2\uff09\u6216\u4f7f\u80fdSPI\uff08SPI\u4f7f\u80fd\uff09\u3002\u672c\u6559\u7a0b\u4e2d\u4f7f\u7528I2C\u7684\u552f\u4e00\u7535\u8def\u662fLCD\u9a71\u52a8\u6a21\u5757\uff0c\u6240\u4ee5\u6211\u4eec\u4e0d\u9700\u8981\u66f4\u6539\u5f53\u524d\u914d\u7f6e\u3002\u8fd9\u610f\u5473\u7740LCD\u9a71\u52a8\u6a21\u5757\u7684\u5730\u5740\u4e3a0\uff080x00\uff09\u3002<\/p>\n<div id=\"attachment_7073\" style=\"width: 645px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7073\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig2-Solder-Jumpers-on-LCD-Backpack.jpg\" alt=\"\u4f7f\u7528Arduino\u9a71\u52a8LCD\u7684DIY\u6307\u5357 LCD\u9a71\u52a8\u6a21\u5757\u4e0a\u7684\u710a\u63a5\u8df3\u7ebf\" width=\"635\" height=\"232\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig2-Solder-Jumpers-on-LCD-Backpack.jpg 635w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig2-Solder-Jumpers-on-LCD-Backpack-300x110.jpg 300w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig2-Solder-Jumpers-on-LCD-Backpack-260x95.jpg 260w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig2-Solder-Jumpers-on-LCD-Backpack-50x18.jpg 50w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig2-Solder-Jumpers-on-LCD-Backpack-150x55.jpg 150w\" sizes=\"auto, (max-width: 635px) 100vw, 635px\" \/><\/p>\n<p class=\"wp-caption-text\">\u56fe2\uff1aLCD\u9a71\u52a8\u6a21\u5757\u4e0a\u7684\u710a\u63a5\u8df3\u7ebf<\/p>\n<\/div>\n<p>\u8981\u5c06LCD\u9a71\u52a8\u6a21\u5757\u8fde\u63a5\u5230Arduino\uff0c\u5e94\u5c065V\u548cArduino\u4e0a\u7684\u63a5\u5730\u5f15\u811a\u8fde\u81f3LCD\u9a71\u52a8\u6a21\u5757\u4e0a\u76845V\u548c\u63a5\u5730\u5f15\u811a\u3002\u8fd9\u4f1a\u4e3aLCD\u548cLCD\u9a71\u52a8\u6a21\u5757\u63d0\u4f9b\u7535\u6e90\u3002\u6ce8\uff1aLCD\u9700\u8981\u81f3\u5c115V\u624d\u80fd\u6b63\u5e38\u5de5\u4f5c\u3002\u63a5\u4e0b\u6765\u7684\u4e24\u4e2a\u8fde\u63a5\u662f\u4e32\u884c\u6570\u636e\u548c\u4e32\u884c\u65f6\u949f\u3002\u4e32\u884c\u65f6\u949f\u8fde\u63a5\uff08\u6a59\u8272\u7ebf\uff09\u4f4d\u4e8eArduino\u7684SCL\u5f15\u811a\u548c\u9a71\u52a8\u6a21\u5757\u7684CLK\u5f15\u811a\u4e4b\u95f4\u3002\u4e32\u884c\u6570\u636e\u8fde\u63a5\uff08\u84dd\u7ebf\uff09\u4f4d\u4e8eArduino\u7684SDA\u5f15\u811a\u548c\u9a71\u52a8\u6a21\u5757\u7684DAT\u5f15\u811a\u4e4b\u95f4\u3002<\/p>\n<div id=\"attachment_7074\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7074\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig3-LCD-Backpack-Pinout.jpg\" alt=\"\u4f7f\u7528Arduino\u9a71\u52a8LCD\u7684DIY\u6307\u5357 LCD\u9a71\u52a8\u6a21\u5757\u5f15\u811a\u5206\u914d\" width=\"500\" height=\"456\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig3-LCD-Backpack-Pinout.jpg 500w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig3-LCD-Backpack-Pinout-300x274.jpg 300w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig3-LCD-Backpack-Pinout-160x146.jpg 160w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig3-LCD-Backpack-Pinout-50x46.jpg 50w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig3-LCD-Backpack-Pinout-82x75.jpg 82w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/p>\n<p class=\"wp-caption-text\">\u56fe3\uff1aLCD\u9a71\u52a8\u6a21\u5757\u5f15\u811a\u5206\u914d<\/p>\n<\/div>\n<h2>2. \u7f16\u5199\u4ee3\u7801<\/h2>\n<p><strong>2.1 \u914d\u7f6e<\/strong><\/p>\n<p>\u4ee3\u7801\u7684\u7b2c\u4e00\u90e8\u5206\u662f\u5305\u542bAdafruit_LiquidCrystal\u5934\u6587\u4ef6\u3002\u7136\u540e\uff0c\u60a8\u5c31\u53ef\u4ee5\u4f7f\u7528\u8be5\u5e93\u4e2d\u7684\u51fd\u6570\u3002\u7531\u4e8eArduino IDE\u4f1a\u81ea\u52a8\u4e0b\u8f7dAdafruit_LiquidCrystal\u5e93\uff0c\u672c\u6559\u7a0b\u6ca1\u6709\u5305\u542bArduino\u5e93\u7684\u4e0b\u8f7d\u6b65\u9aa4\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u5c06LCD\u9a71\u52a8\u6a21\u5757\u5730\u5740\u8bbe\u4e3a0\uff08\u8bf7\u8bb0\u4f4f\uff0c\u6211\u4eec\u6ca1\u6709\u8de8\u63a5\u4efb\u4f55\u710a\u63a5\u8df3\u7ebf\uff09\u3002<\/p>\n<p>\u6700\u540e\uff0c\u6211\u521b\u5efa\u4e86\u4e00\u4e2a\u540d\u4e3atimer\u7684\u5168\u5c40\u53d8\u91cf\uff0c\u7a0d\u540e\u5728\u4ee3\u7801\u7684\u5faa\u73af\u90e8\u5206\u4e2d\u4f7f\u7528\u3002<\/p>\n<p><strong>2.2 \u8bbe\u7f6e<\/strong><\/p>\n<p>LCD\u5728\u5199\u5165\u4e4b\u524d\u9700\u8981\u8fdb\u884c\u521d\u59cb\u5316\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u201cbegin\u201d\u51fd\u6570\u5b9e\u73b0\uff0c\u8be5\u51fd\u6570\u4f1a\u544a\u8bc9LCD\u9a71\u52a8\u6a21\u5757\u663e\u793a\u5668\u4e0a\u6709\u591a\u5c11\u4e2a\u5b57\u7b26\u3002\u7531\u4e8e\u6211\u4f7f\u7528\u7684LCD\u5177\u6709\u80cc\u5149\u529f\u80fd\uff0c\u56e0\u6b64\u6211\u4e5f\u6253\u5f00\u80cc\u5149\u3002<\/p>\n<p>\u73b0\u5728LCD\u5df2\u7ecf\u521d\u59cb\u5316\u5b8c\u6bd5\uff0c\u6211\u5199\u4e86\u201cTest Code\u201d\u6765\u68c0\u67e5\u4e00\u5207\u662f\u5426\u6b63\u5e38\u3002\u8be5\u4ee3\u7801\u5c06\u5149\u6807\u8bbe\u5b9a\u4e3a\u8d77\u59cb\u4f4d\u7f6e\uff0c\u5c06\u201cTest\u201d\u5199\u5165\u663e\u793a\u5c4f\uff0c\u7b49\u5f852\u79d2\u949f\uff0c\u7136\u540e\u6e05\u9664\u663e\u793a\u3002<\/p>\n<div id=\"attachment_7076\" style=\"width: 710px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7076\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig4-Setup-Code.jpg\" alt=\"\u4f7f\u7528Arduino\u9a71\u52a8LCD\u7684DIY\u6307\u5357 \u8bbe\u7f6e\u4ee3\u7801\" width=\"700\" height=\"218\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig4-Setup-Code.jpg 700w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig4-Setup-Code-300x93.jpg 300w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig4-Setup-Code-260x81.jpg 260w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig4-Setup-Code-50x16.jpg 50w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig4-Setup-Code-150x47.jpg 150w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<p class=\"wp-caption-text\">\u56fe4\uff1a\u8bbe\u7f6e\u4ee3\u7801<\/p>\n<\/div>\n<p><strong>2.3 \u5faa\u73af<\/strong><\/p>\n<p>\u4ee3\u7801\u7684\u5faa\u73af\u90e8\u5206\u5229\u7528millis\uff08\uff09\u51fd\u6570\u5e76\u9664\u4ee51000\u6765\u8ba1\u7b97\u7a0b\u5e8f\u7684\u8fd0\u884c\u65f6\u95f4\u3002\u7136\u540e\u4ee3\u7801\u4f7f\u7528print\u548csetCursor\u51fd\u6570\u5728LCD\u4e0a\u663e\u793a\u7a0b\u5e8f\u65f6\u95f4\u3002\u968f\u540e\uff0c\u5faa\u73af\u4ee3\u7801\u7b49\u5f85\u4e00\u79d2\u949f\uff0c\u7136\u540e\u91cd\u590d\u3002<\/p>\n<div id=\"attachment_7077\" style=\"width: 710px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7077\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig5-Loop-Code.jpg\" alt=\"\u4f7f\u7528Arduino\u9a71\u52a8LCD\u7684DIY\u6307\u5357 \u5faa\u73af\u4ee3\u7801\" width=\"700\" height=\"199\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig5-Loop-Code.jpg 700w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig5-Loop-Code-300x85.jpg 300w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig5-Loop-Code-260x74.jpg 260w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig5-Loop-Code-50x14.jpg 50w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig5-Loop-Code-150x43.jpg 150w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<p class=\"wp-caption-text\">\u56fe5\uff1a\u5faa\u73af\u4ee3\u7801<\/p>\n<\/div>\n<h2>3. \u4e0a\u4f20\u5e76\u8fd0\u884c\u7a0b\u5e8f<\/h2>\n<p>\u5c06\u4ee3\u7801\u4e0a\u4f20\u5230Arduino\u3002\u786e\u4fddArduino\u5df2\u7ecf\u8fde\u63a59V\u7535\u6e90\u9002\u914d\u5668\uff0c\u56e0\u4e3aUSB\u7535\u6e90\u4e0d\u8db3\u4ee5\u4e3aArduino\u548cLCD\u663e\u793a\u5668\u540c\u65f6\u4f9b\u7535\u3002\u7a0b\u5e8f\u5f00\u59cb\u6267\u884c\u540e\uff0c\u8bbe\u7f6e\u90e8\u5206\u8fd0\u884c\u5b8c\u6210\u540e\uff0c\u60a8\u5e94\u8be5\u5728LCD\u663e\u793a\u5c4f\u4e0a\u770b\u5230\u201cTest\u201d\u5b57\u6837\uff08\u56fe6\uff1aLCD\u663e\u793a\u201cTest\u201d\uff09\u3002\u5faa\u73af\u90e8\u5206\u5f00\u59cb\u6267\u884c\u540e\uff0c\u60a8\u5c06\u4f1a\u770b\u5230\u7a0b\u5e8f\u7684\u8fd0\u884c\u65f6\u95f4\uff0c\u800c\u4e14\u6bcf\u79d2\u66f4\u65b0\u4e00\u6b21\uff08\u56fe7\uff1aLCD\u663e\u793a\u7a0b\u5e8f\u8fd0\u884c\u65f6\u95f4 &#8211; 8(s)\uff09\u3002\u606d\u559c\uff01\u60a8\u73b0\u5728\u62e5\u6709\u4e00\u6b3e\u9002\u7528\u4e8eArduino\u677f\u7684\u7b80\u5355\u6613\u7528LCD\u663e\u793a\u5c4f\uff0c\u5e76\u53ef\u5c06\u5176\u7528\u4f5c\u672a\u6765\u9879\u76ee\u7684\u663e\u793a\u5c4f\u3002\u63d0\u793a\uff1aI2C\u662f\u4e00\u4e2a\u6162\u901f\u603b\u7ebf\uff0c\u5982\u679c\u60a8\u6301\u7eed\u66f4\u65b0\u6db2\u6676\u663e\u793a\u5668\uff0c\u90a3\u4e48\u4f1a\u5f71\u54cd\u5355\u7247\u673a\u6267\u884c\u5176\u4ed6\u4efb\u52a1\u7684\u65f6\u95f4\u3002<\/p>\n<div id=\"attachment_7079\" style=\"width: 710px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7079\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig6-LCD-Displaying-Test.jpg\" alt=\"\u4f7f\u7528Arduino\u9a71\u52a8LCD\u7684DIY\u6307\u5357 LCD\u663e\u793a \u201cTest\u201d\" width=\"700\" height=\"933\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig6-LCD-Displaying-Test.jpg 700w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig6-LCD-Displaying-Test-225x300.png 225w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig6-LCD-Displaying-Test-110x146.png 110w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig6-LCD-Displaying-Test-38x50.png 38w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig6-LCD-Displaying-Test-56x75.png 56w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<p class=\"wp-caption-text\">\u56fe6\uff1aLCD\u663e\u793a &#8220;Test&#8221;<\/p>\n<\/div>\n<div id=\"attachment_7080\" style=\"width: 710px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7080\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig7-LCD-Display-Program-Runtime.jpg\" alt=\"\u4f7f\u7528Arduino\u9a71\u52a8LCD\u7684DIY\u6307\u5357 LCD\u663e\u793a\u7a0b\u5e8f\u8fd0\u884c\u65f6\u95f4 \u2013 8(s)\" width=\"700\" height=\"933\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig7-LCD-Display-Program-Runtime.jpg 700w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig7-LCD-Display-Program-Runtime-225x300.png 225w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig7-LCD-Display-Program-Runtime-110x146.png 110w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig7-LCD-Display-Program-Runtime-38x50.png 38w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig7-LCD-Display-Program-Runtime-56x75.png 56w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<p class=\"wp-caption-text\">\u56fe7\uff1aLCD\u663e\u793a\u7a0b\u5e8f\u8fd0\u884c\u65f6\u95f4 \u2013 8(s)<\/p>\n<\/div>\n<div id=\"attachment_7081\" style=\"width: 710px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-7081\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig8-LCD-Displaying-Program-Runtime-28.jpg\" alt=\"\u4f7f\u7528Arduino\u9a71\u52a8LCD\u7684DIY\u6307\u5357 LCD\u663e\u793a\u7a0b\u5e8f\u8fd0\u884c\u65f6\u95f4 \u2013 28(s)\" width=\"700\" height=\"933\" srcset=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig8-LCD-Displaying-Program-Runtime-28.jpg 700w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig8-LCD-Displaying-Program-Runtime-28-225x300.png 225w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig8-LCD-Displaying-Program-Runtime-28-110x146.png 110w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig8-LCD-Displaying-Program-Runtime-28-38x50.png 38w, https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2018\/02\/Arduino_LCD-Fig8-LCD-Displaying-Program-Runtime-28-56x75.png 56w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<p class=\"wp-caption-text\">\u56fe8\uff1aLCD\u663e\u793a\u7a0b\u5e8f\u8fd0\u884c\u65f6\u95f4 \u2013 28(s)<\/p>\n<\/div>\n<p><strong>\u9644\u4ef6\uff1aArduino_LED\u4ee3\u7801<\/strong><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-c\" data-lang=\"C\"><code>\/*       Project: Arduino LCD\r\n *       Written by: Chris Marella                            \r\n *       Date: January 11, 2018                                                                    \r\n *\/                                                         \r\n\r\n\/\/ include the Adafruit LCD Library:\r\n#include \r\n\r\n\/\/ Connect the the LCD Backpack via I2C, default address #0 (A0-A2 not jumpered)\r\nAdafruit_LiquidCrystal lcd(0);\r\n\r\n\/\/Global Variables\r\nint timer;    \/\/create a global variable for a timer\r\n\r\nvoid setup() {\r\n\r\n  \/\/LCD Configuration\r\n  lcd.begin(19,3);        \/\/The begin function tells the LCD driver the size of your LCD screen (columns x rows)\r\n  lcd.setBacklight(HIGH); \/\/setBacklight controls the LCD backlight\r\n\r\n  \/\/Test Code\r\n  lcd.setCursor(0,0);     \/\/setCursor function sets the position of the character cursor (column x row)\r\n  lcd.print(\"Test\");      \/\/Prints \"Test\" across the LCD\r\n  delay(2000);            \/\/Wait for 2 seconds\r\n  lcd.clear();            \/\/clear function clears the LCD screen\r\n\r\n}\r\n\r\nvoid loop() {\r\n  timer = millis()\/1000;  \/\/set timer variable to how long program has been running in seconds\r\n\r\n  lcd.setCursor(0,0);     \/\/set LCD cursor to 0,0\r\n  lcd.print(\"Time:\");     \/\/print time on LCD row 1\r\n  lcd.setCursor(0,1);     \/\/move LCD cursor to row 2\r\n  lcd.print(timer);       \/\/print the current program run time\r\n  lcd.setCursor(0,2);     \/\/move LCD cursor to row 3\r\n  lcd.print(\"(s)\");       \/\/print \"(s)\" for seconds\r\n  delay(1000);            \/\/wait 1 second to update\r\n}\r\n<\/code><\/pre>\n<\/div>\n<p>&nbsp;<\/p>\n<div class=\"author-box-wrapper\">\n<div class=\"avatar-wrapper\">\n\t\t<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/micro.wfjydl.com\/deviceplus\/wp-content\/uploads\/2018\/08\/Device-Plus-logo-for-author-info-75x75.png\" width=\"64\" height=\"64\" alt=\"DevicePlus \u7f16\u8f91\u56e2\u961f\">\n\t<\/div>\n<div class=\"desc-wrapper\">\n<h5>DevicePlus \u7f16\u8f91\u56e2\u961f<\/h5>\n<div class=\"desc\">\n<p>\u8bbe\u5907\u5347\u7ea7\u7248\u9002\u7528\u4e8e\u6240\u6709\u70ed\u7231\u7535\u5b50\u548c\u673a\u7535\u4e00\u4f53\u5316\u7684\u4eba\u3002<\/p>\n<\/div><\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"\u8fd9\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8eDevicePlus.com\u82f1\u8bed\u7f51\u7ad9\u7684\u7ffb\u8bd1\u7a3f\u3002 \u5229\u7528Arduino\u9a71\u52a8LCD\u663e\u793a\u5c4f &nbsp; \u76ee\u7684 \u672c\u6559\u7a0b\u63cf\u8ff0\u4e86\u5982\u4f55\u4f7f\u7528Arduino\u9a71\u52a8LCD\u663e\u793a\u5c4f\u3002 \u6982\u8ff0 Arduino\u5f00\u53d1\u677f\u5c5e\u4e8e\u975e\u5e38\u6d41\u884c\u7684\u5355\u7247\u673a\u5f00 [&hellip;]","protected":false},"author":3,"featured_media":20709,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1130],"tags":[],"class_list":["post-6866","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino"],"acf":[],"wps_subtitle":"","_links":{"self":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/6866","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\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/comments?post=6866"}],"version-history":[{"count":9,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/6866\/revisions"}],"predecessor-version":[{"id":21500,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/6866\/revisions\/21500"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/media\/20709"}],"wp:attachment":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/media?parent=6866"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/categories?post=6866"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/tags?post=6866"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}