{"id":2894,"date":"2020-10-21T09:36:58","date_gmt":"2020-10-21T01:36:58","guid":{"rendered":"http:\/\/www.rotor.com.tw\/?p=2894"},"modified":"2020-10-21T09:38:48","modified_gmt":"2020-10-21T01:38:48","slug":"04-arduino%e8%bc%b8%e5%87%ba%e8%a8%8a%e6%81%af%e5%88%a9%e5%99%a8-lcd1602%e6%b6%b2%e6%99%b6%e9%a1%af%e7%a4%ba%e5%99%a8","status":"publish","type":"post","link":"https:\/\/www.rotor.com.tw\/?p=2894","title":{"rendered":"#04 Arduino\u8f38\u51fa\u8a0a\u606f\u5229\u5668-LCD1602\u6db2\u6676\u986f\u793a\u5668"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">LiquidCrystal 1602 \u4ecb\u7d39<\/h2>\n\n\n\n<p>Arduino \u662f\u4e00\u500b\u53ef\u7a0b\u5f0f\u7684\u63a7\u5236\u88dd\u7f6e\uff0c\u53ea\u8981\u60a8\u719f\u6089\u57fa\u672c\u7684C\u8a9e\u8a00\u7a0b\u5f0f\u908f\u8f2f\uff0c\u52a0\u4e0aArduino\u7684I\/O\u63a7\u5236\u65b9\u6cd5\uff0c\u5373\u53ef\u9032\u5165\u7522\u54c1\u958b\u767c\u5be6\u6230\u3002<\/p>\n\n\n\n<p>\u4e00\u822c\u7684\u4e92\u52d5\u5f0f\u7522\u54c1\u8a2d\u8a08\u901a\u5e38\u5177\u5099\u4e00\u500b\u8cc7\u8a0a\u986f\u793a\u88dd\u7f6e\uff0c\u5728Arduino\u7684\u9818\u57df\u7d93\u5e38\u6703\u4f7f\u7528\u4fbf\u5b9c\u53c8\u5927\u7897\u7684LCD1602\u7684\u6db2\u6676\u986f\u793a\u5668\u3002LCD1602\u9867\u540d\u601d\u7fa9\u5c31\u662f\u4e00\u7a2e\u5c0f\u578b\u7684\u6db2\u6676\u986f\u793a\u5668\uff0c\u53ef\u4ee5\u986f\u793a\u55ae\u4e00\u521716\u500b\u5b57\u5143\u7684\u9577\u5ea6\uff0c\u4e00\u6b21\u53ef\u4ee5\u986f\u793a\u5169\u5217\u3002\u9019\u7a2e\u88dd\u7f6e\u7d93\u5e38\u5728DVD\u64ad\u653e\u6a5f\u3001\u6a5f\u4e0a\u76d2\u3001\u96fb\u8166\u6a5f\u6bbc\u8207\u78c1\u789f\u9663\u5217\u63a7\u5236\u5668\u4f7f\u7528\u3002<\/p>\n\n\n\n<p>Arduino\u60f3\u8981\u6574\u5408LCD1602\u662f\u4e00\u4ef6\u975e\u5e38\u7c21\u55ae\u7684\u5de5\u4f5c\uff0c\u5df2\u7d93\u6709\u8a31\u591a\u7a2e\u7a0b\u5f0f\u5eab(library)\u63d0\u4f9b\u64cd\u4f5c\u4ecb\u9762\u4f9b\u60a8\u4f7f\u7528\uff0c\u6700\u8457\u540d\u7684\u7a0b\u5f0f\u5eab\u5c31\u662fLiquidCrystal.h\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"584\" height=\"326\" src=\"https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102005.png?resize=584%2C326&#038;ssl=1\" alt=\"\" class=\"wp-image-2914\" srcset=\"https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102005.png?resize=1024%2C571&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102005.png?resize=300%2C167&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102005.png?resize=768%2C428&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102005.png?resize=500%2C279&amp;ssl=1 500w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102005.png?w=1280&amp;ssl=1 1280w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102005.png?w=1168&amp;ssl=1 1168w\" sizes=\"(max-width: 584px) 100vw, 584px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<!--more-->\n\n\n\n<h2 class=\"wp-block-heading\">LCD1602\u786c\u9ad4<\/h2>\n\n\n\n<p>\u50b3\u7d71\u7684LCD1602\u6db2\u6676\u986f\u793a\u5668\u662f\u5177\u5099 4bit \/ 8bit \u8cc7\u8a0a\u50b3\u8f38\u7684\u65b9\u5f0f\uff0c\u56e0\u6b64\u914d\u7f6e\u670916\u500b\u91dd\u8173\uff0c\u9019\u4e9b\u91dd\u8173\u53ef\u5206\u70ba\u4ee5\u4e0b\u985e\u5225\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>\u63a5\u8173\u4ee3\u865f<\/td><td>\u529f\u80fd\u8aaa\u660e<\/td><\/tr><tr><td>GND<\/td><td>\u5e38\u898b\u7b26\u865f\u5982VSS\uff0c\u9023\u63a5\u96fb\u6e90\u7684\u8ca0\u6975\u3002<\/td><\/tr><tr><td>VCC<\/td><td>\u5e38\u898b\u7b26\u865f\u5982VDD\uff0c\u9023\u63a5\u96fb\u6e90+5V\u3002<\/td><\/tr><tr><td>VO<\/td><td>\u900f\u904e\u96fb\u4f4d\u8a08\u5206\u58d3\u539f\u7406\uff0c\u8abf\u6574\u5b57\u9ad4\u7684\u5c0d\u6bd4\u4eae\u5ea6\u3002<\/td><\/tr><tr><td>RS<\/td><td>\u66ab\u5b58\u5668\u7684\u529f\u80fd\u8a2d\u5b9a\uff0c<br>\u9ad8\u96fb\u4f4d(HIGH)\u5c07D0~D7\u8cc7\u6599\u653e\u5165\u8cc7\u6599\u66ab\u5b58\u5668\u3002<br>\u4f4e\u96fb\u4f4d(LOW)\u5c07D0~D7\u8cc7\u6599\u653e\u5165\u6307\u4ee4\u66ab\u5b58\u5668\u3002<\/td><\/tr><tr><td>RW<\/td><td>Read\/Write \u6a21\u5f0f\u8a2d\u5b9a\u3002<br>\u9ad8\u96fb\u4f4d(HIGH)\u5f9eLCD\u8b80\u53d6\u8cc7\u6599\u3002<br>\u4f4e\u96fb\u4f4d(LOW)\u5c07\u8cc7\u6599\u5beb\u5165LCD\u3002<\/td><\/tr><tr><td>E<\/td><td>Enable\/Disable read information.<br>\u9ad8\u96fb\u4f4d(HIGH)\u555f\u7528\u529f\u80fd<\/td><\/tr><tr><td>D0~D7<\/td><td>\u8cc7\u6599\u4f4d\u5143\u7d44\u50b3\u9001\/\u63a5\u6536<\/td><\/tr><tr><td>LED+<\/td><td>\u6db2\u6676\u80cc\u5149\u7167\u660e LED+<\/td><\/tr><tr><td>LED-<\/td><td>\u6db2\u6676\u80cc\u5149\u7167\u660e LED-<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"584\" height=\"270\" src=\"https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102001.png?resize=584%2C270&#038;ssl=1\" alt=\"\" class=\"wp-image-2896\" srcset=\"https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102001.png?resize=1024%2C473&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102001.png?resize=300%2C139&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102001.png?resize=768%2C355&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102001.png?resize=1536%2C709&amp;ssl=1 1536w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102001.png?resize=500%2C231&amp;ssl=1 500w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102001.png?w=1587&amp;ssl=1 1587w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102001.png?w=1168&amp;ssl=1 1168w\" sizes=\"(max-width: 584px) 100vw, 584px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u9ede\u4eaeLCD1602\u80cc\u5149<\/h2>\n\n\n\n<p>Tinkercad\u7dda\u4e0a\u6a21\u64ec\u63d0\u4f9bLCD1602\u88dd\u7f6e\uff0c\u5f9e\u6700\u57fa\u672c\u7684\u4f9b\u96fb\u9023\u63a5\u80cc\u5149\u958b\u59cb\u7df4\u7fd2\u3002LED+\u3001LED-\u9019\u5169\u500b\u8173\u4f4d\u662f\u80cc\u5149\u7684\u4f9b\u96fb\u8173\u4f4d\uff0c\u82e5\u5728+5V\u4f9b\u96fb\u4e0b\uff0c\u8a18\u5f97\u4e32\u806f220\u6216330\u6b50\u59c6\u7684\u96fb\u963b\u4f5c\u70ba\u9650\u6d41\u96fb\u963b\uff0c\u907f\u514d\u9577\u6642\u9593\u8655\u5728\u904e\u9ad8\u96fb\u6d41\u800c\u5c07\u80cc\u5149LED\u71d2\u6bc0\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"584\" height=\"681\" src=\"https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102002.png?resize=584%2C681&#038;ssl=1\" alt=\"\" class=\"wp-image-2898\" srcset=\"https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102002.png?w=829&amp;ssl=1 829w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102002.png?resize=257%2C300&amp;ssl=1 257w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102002.png?resize=768%2C895&amp;ssl=1 768w\" sizes=\"(max-width: 584px) 100vw, 584px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">LCD1602\u63a7\u5236\u5668\u4f9b\u96fb\u3001\u96fb\u4f4d\u8a08\u8abf\u6574LCD\u5b57\u9ad4\u5c0d\u6bd4<\/h2>\n\n\n\n<p>\u5c07GND\u3001VCC\u52a0\u5165+5V\u96fb\u58d3\uff0c\u8b93LCD\u63a7\u5236\u5668\u958b\u59cb\u5de5\u4f5c\u3002\u4f7f\u7528\u96fb\u4f4d\u8a08\u5206\u58d3\u539f\u7406\u63a7\u5236VO\u96fb\u58d3\uff0c\u8abf\u6574\u5b57\u9ad4\u5c0d\u6bd4\u6548\u679c\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"584\" height=\"683\" src=\"https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102003-1.png?resize=584%2C683&#038;ssl=1\" alt=\"\" class=\"wp-image-2906\" srcset=\"https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102003-1.png?resize=876%2C1024&amp;ssl=1 876w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102003-1.png?resize=257%2C300&amp;ssl=1 257w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102003-1.png?resize=768%2C897&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102003-1.png?w=890&amp;ssl=1 890w\" sizes=\"(max-width: 584px) 100vw, 584px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>LCD\u7684\u4f9b\u96fb\u3001\u80cc\u5149\u4f9b\u96fb\u4ee5\u53ca\u4f7f\u7528\u5206\u58d3\u65b9\u5f0f\u63a7\u5236\u5b57\u9ad4\u5c0d\u6bd4\u7684\u7c21\u55ae\u96fb\u8def\u53ef\u4ee5\u900f\u904e\u96fb\u6c60\u4f9b\u96fb\u65b9\u5f0f\u6a21\u64ec\u793a\u7bc4\uff0c\u6587\u5b57\u7684\u986f\u793a\u64cd\u4f5c\u5247\u9700\u4f7f\u7528Arduino\u9032\u884c\u63a7\u5236\uff0c\u5f8c\u7e8c\u7684\u8aaa\u660e\u5247\u4ee5Arduino\u9032\u884c\u4ecb\u7d39\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f7f\u7528Arduino LCD1602 \u7bc4\u4f8b\u7a0b\u5f0f\u6a21\u64ec\u7df4\u7fd2<\/h2>\n\n\n\n<p>Arduino IDE\u8edf\u9ad4\u63d0\u4f9b LCD1602 HelloWorld\u7bc4\u4f8b\u7a0b\u5f0f\uff0c\u53ef\u5f9e\u9078\u55ae\u5167\u76f4\u63a5\u4f7f\u7528\uff0c\u64cd\u4f5c\u5982\u4e0b\u5716\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"584\" height=\"526\" src=\"https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102004.png?resize=584%2C526&#038;ssl=1\" alt=\"\" class=\"wp-image-2909\" srcset=\"https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102004.png?resize=1024%2C922&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102004.png?resize=300%2C270&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102004.png?resize=768%2C692&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102004.png?resize=333%2C300&amp;ssl=1 333w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102004.png?w=1249&amp;ssl=1 1249w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102004.png?w=1168&amp;ssl=1 1168w\" sizes=\"(max-width: 584px) 100vw, 584px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<p>\u6b64\u6642Arduino IDE\u6703\u5c07LCD1602\u7bc4\u4f8b\u7a0b\u5f0f\u78bc\u8f09\u5165\uff0c\u5176\u4e2d\u7b2c48\u884c\u5c31\u662f\u5ba3\u544aArduino \u8207 LCD1602\u63a5\u7dda\u7684\u65b9\u5f0f\uff0c\u5f8c\u7e8c\u7684LCD1602\u8a0a\u606f\u986f\u793a\u76f4\u63a5\u547c\u53eb\u7a0b\u5f0f\u5eab\u64cd\u4f5c\u5373\u53ef\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: arduino; highlight: [48]; title: ; notranslate\" title=\"\">\n\/*\n  LiquidCrystal Library - Hello World\n\n Demonstrates the use a 16x2 LCD display.  The LiquidCrystal\n library works with all LCD displays that are compatible with the\n Hitachi HD44780 driver. There are many of them out there, and you\n can usually tell them by the 16-pin interface.\n\n This sketch prints &quot;Hello World!&quot; to the LCD\n and shows the time.\n\n  The circuit:\n * LCD RS pin to digital pin 12\n * LCD Enable pin to digital pin 11\n * LCD D4 pin to digital pin 5\n * LCD D5 pin to digital pin 4\n * LCD D6 pin to digital pin 3\n * LCD D7 pin to digital pin 2\n * LCD R\/W pin to ground\n * LCD VSS pin to ground\n * LCD VCC pin to 5V\n * 10K resistor:\n * ends to +5V and ground\n * wiper to LCD VO pin (pin 3)\n\n Library originally added 18 Apr 2008\n by David A. Mellis\n library modified 5 Jul 2009\n by Limor Fried (http:\/\/www.ladyada.net)\n example added 9 Jul 2009\n by Tom Igoe\n modified 22 Nov 2010\n by Tom Igoe\n modified 7 Nov 2016\n by Arturo Guadalupi\n\n This example code is in the public domain.\n\n http:\/\/www.arduino.cc\/en\/Tutorial\/LiquidCrystalHelloWorld\n\n*\/\n\n\/\/ include the library code:\n#include &lt;LiquidCrystal.h&gt;\n\n\/\/ initialize the library by associating any needed LCD interface pin\n\/\/ with the arduino pin number it is connected to\nconst int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;\nLiquidCrystal lcd(rs, en, d4, d5, d6, d7);\n\nvoid setup() {\n  \/\/ set up the LCD&#039;s number of columns and rows:\n  lcd.begin(16, 2);\n  \/\/ Print a message to the LCD.\n  lcd.print(&quot;hello, world!&quot;);\n}\n\nvoid loop() {\n  \/\/ set the cursor to column 0, line 1\n  \/\/ (note: line 1 is the second row, since counting begins with 0):\n  lcd.setCursor(0, 1);\n  \/\/ print the number of seconds since reset:\n  lcd.print(millis() \/ 1000);\n}\n\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">\u900f\u904eTinkercad\u9032\u884c\u96fb\u8def\u5be6\u4f5c\u8207\u6a21\u64ec<\/h2>\n\n\n\n<p>\u4f7f\u7528Tinkercad \u5b8c\u6210 Arduino \u8207LCD1602\u7684\u63a5\u7dda(\u52d9\u5fc5\u53c3\u8003\u7a0b\u5f0f\u78bc48\u884c\u6240\u5b9a\u7fa9\u7684\u65b9\u5f0f\u9023\u63a5)\uff0c\u7a0b\u5f0f\u78bc\u4f7f\u7528\u4e0a\u65b9\u7684\u7bc4\u4f8b\u7a0b\u5f0f\uff0c\u8cbc\u4e0aTinkercad\u7684Arduino\u7a0b\u5f0f\u78bc\u4e4b\u5f8c\uff0c\u5373\u53ef\u9032\u884c\u7dda\u4e0a\u6a21\u64ec\uff0c\u5b8c\u6210\u5f8c\u5982\u4e0b\u5716\u6240\u793a\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"584\" height=\"326\" src=\"https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102005.png?resize=584%2C326&#038;ssl=1\" alt=\"\" class=\"wp-image-2914\" srcset=\"https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102005.png?resize=1024%2C571&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102005.png?resize=300%2C167&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102005.png?resize=768%2C428&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102005.png?resize=500%2C279&amp;ssl=1 500w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102005.png?w=1280&amp;ssl=1 1280w, https:\/\/i0.wp.com\/www.rotor.com.tw\/wp-content\/uploads\/2020\/10\/2020102005.png?w=1168&amp;ssl=1 1168w\" sizes=\"(max-width: 584px) 100vw, 584px\" data-recalc-dims=\"1\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f7f\u7528\u7a0b\u5f0f\u5eab\u63a7\u5236LCD\u986f\u793a\u6587\u5b57\u65b9\u6cd5<\/h2>\n\n\n\n<p>\u900f\u904e\u7bc4\u4f8b\u7a0b\u5f0f\u53ef\u4ee5\u4e86\u89e3\u8f38\u51fa\u6587\u5b57\u81f3LCD\u662f\u4e00\u4ef6\u975e\u5e38\u7c21\u55ae\u7684\u4e8b\u60c5\uff0c\u53ea\u8981\u5b78\u6703\u4e0b\u65b9\u7684\u5169\u500b\u65b9\u6cd5\uff0c\u57fa\u672c\u63a7\u5236\u5c31\u641e\u5b9a\u4e86\u3002<\/p>\n\n\n\n<ul><li>\u7a0b\u5f0f\u78bc\u7b2c\u4e94\u884c lcd.print(); \u8f38\u51fa\u6587\u5b57\u81f3LCD\u87a2\u5e55<\/li><li>\u7a0b\u5f0f\u78bc11\u884c\uff1alcd.setCursor(x, y); \u5c07\u6e38\u6a19\u79fb\u52d5\u81f3x,y \u7684\u4f4d\u7f6e\u4e0a\uff0c\u4e0b\u4e00\u6b21\u8f38\u51fa\u6587\u5b57\u7684\u5b9a\u4f4d\u5ea7\u6a19\u3002<\/li><\/ul>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: arduino; highlight: [5,11]; title: ; notranslate\" title=\"\">\nvoid setup() {\n  \/\/ set up the LCD&#039;s number of columns and rows:\n  lcd.begin(16, 2);\n  \/\/ Print a message to the LCD.\n  lcd.print(&quot;hello, world!&quot;);\n}\n\nvoid loop() {\n  \/\/ set the cursor to column 0, line 1\n  \/\/ (note: line 1 is the second row, since counting begins with 0):\n  lcd.setCursor(0, 1);\n  \/\/ print the number of seconds since reset:\n  lcd.print(millis() \/ 1000);\n}\n<\/pre><\/div>\n\n\n<h2 class=\"wp-block-heading\">\u5c0f\u7d50<\/h2>\n\n\n\n<p>\u672c\u7ae0\u7bc0\u63d0\u4f9bLCD1602\u7684\u786c\u9ad4\u96fb\u8def\u5be6\u4f5c\u539f\u7406\u8207\u8edf\u9ad4\u63a7\u5236\u65b9\u5f0f\uff0c\u4e0b\u4e00\u7bc7\u53ef\u4ee5\u958b\u59cb\u958b\u767c\u4e00\u500b\u7c21\u6613\u578b\u7684\u4e92\u52d5\u88dd\u7f6e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>LiquidCrystal 1602 \u4ecb\u7d39 Arduino \u662f\u4e00\u500b\u53ef\u7a0b\u5f0f\u7684\u63a7\u5236\u88dd &hellip; <a href=\"https:\/\/www.rotor.com.tw\/?p=2894\">\u95b1\u8b80\u5168\u6587 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false},"categories":[57],"tags":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.rotor.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/2894"}],"collection":[{"href":"https:\/\/www.rotor.com.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rotor.com.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rotor.com.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rotor.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2894"}],"version-history":[{"count":20,"href":"https:\/\/www.rotor.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/2894\/revisions"}],"predecessor-version":[{"id":2920,"href":"https:\/\/www.rotor.com.tw\/index.php?rest_route=\/wp\/v2\/posts\/2894\/revisions\/2920"}],"wp:attachment":[{"href":"https:\/\/www.rotor.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2894"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rotor.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2894"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rotor.com.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}