{"id":1517,"date":"2021-05-27T11:39:55","date_gmt":"2021-05-27T03:39:55","guid":{"rendered":"http:\/\/mgspace.wiki\/docs\/?post_type=docs&#038;p=1517"},"modified":"2021-05-27T11:40:41","modified_gmt":"2021-05-27T03:40:41","slug":"88%e7%82%b9%e9%98%b5%e5%b1%8f","status":"publish","type":"docs","link":"http:\/\/mgspace.wiki\/docs\/?docs=88%e7%82%b9%e9%98%b5%e5%b1%8f","title":{"rendered":"8*8\u70b9\u9635\u5c4f"},"content":{"rendered":"\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/2020\/10\/Arduino-Tutorial-for-Interfacing-MAX7219-LED-Display-Module.jpg\" alt=\"Arduino\u63a5\u53e3\u63a5\u53e3MAX7219-LED\u663e\u793a\u6a21\u5757\"\/><\/figure>\n\n\n\n<p>\u8fdf\u65e9\uff0cArduino\u53d1\u70e7\u53cb\u603b\u662f\u4f1a\u9047\u5230\u70b9\u77e9\u9635\u663e\u793a\u3002\u5b83\u662f\u4e8c\u7ef4\u56fe\u6848\u5316\u7684LED\u9635\u5217\uff0c\u7528\u4e8e\u8868\u793a\u5b57\u7b26\uff0c\u7b26\u53f7\u548c\u56fe\u50cf\u3002\u51e0\u4e4e\u6240\u6709\u73b0\u4ee3\u6237\u5916LED\u663e\u793a\u5668\u90fd\u4f7f\u7528\u70b9\u77e9\u9635\u3002<\/p>\n\n\n\n<p>\u800c\u4e14\uff0c\u6ca1\u6709\u4ec0\u4e48\u6bd4MAX7219 IC\u66f4\u597d\u7684\u9009\u62e9\u4e86\u3002\u8fd9\u662f\u63a7\u5236\u5355\u4e2a\u77e9\u9635\u7684\u7b80\u5355\u4e14\u6709\u70b9\u4fbf\u5b9c\u7684\u65b9\u5f0f\u3002\u6b64\u5916\uff0c\u5b83\u4eec\u53ef\u4ee5\u94fe\u63a5\u5728\u4e00\u8d77\uff0c\u4ee5\u63a7\u200b\u200b\u5236\u8f83\u5927\u9879\u76ee\u4e2d\u7684\u4e24\u4e2a\u6216\u591a\u4e2a\u70b9\u77e9\u9635\u3002<\/p>\n\n\n\n<p>\u603b\u4f53\u800c\u8a00\uff0c\u5b83\u4eec\u5f88\u6709\u8da3\uff0c\u4e5f\u975e\u5e38\u6709\u7528\uff0c\u6240\u4ee5\u8ba9\u6211\u4eec\u5f00\u59cb\u5427\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"max7219-module-overview\">MAX7219\u6a21\u5757\u6982\u8ff0<\/h2>\n\n\n\n<p>MAX7219\u5206\u652f\u677f\u6709\u51e0\u79cd\uff0c\u5176\u4e2d\u4e24\u79cd\u66f4\u4e3a\u6d41\u884c-\u4e00\u79cd\u662f\u901a\u7528\u6a21\u5757\uff0c\u53e6\u4e00\u79cd\u662fFC-16\u6a21\u5757\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/MAX7219-Module-Variants.jpg\" alt=\"max7219\u6a21\u5757\u53d8\u4f53\"\/><\/figure>\n\n\n\n<p>\u5178\u578b\u7684MAX7219\u6a21\u5757\u5305\u542b\u4e00\u4e2a8\u00d78\u70b9\u77e9\u9635\u663e\u793a\u5668\u548c\u4e00\u4e2aMAX7219 LED\u663e\u793a\u9a71\u52a8\u5668\u3002\u8ba9\u6211\u4eec\u4e00\u4e00\u4e86\u89e3\u4ed6\u4eec\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"the-dot-matrix-display\">\u70b9\u77e9\u9635\u663e\u793a<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/8x8-Dot-Matrix-Display.jpg\" alt=\"8x8\u70b9\u9635\u663e\u793a\"\/><\/figure>\n\n\n\n<p>\u5178\u578b\u7684\u5355\u82728\u00d78\u70b9\u77e9\u9635\u5355\u5143\u5177\u670916\u4e2a\u5f15\u811a\uff0c\u6bcf\u884c8\u4e2a\u9488\u811a\uff0c\u6bcf\u52178\u4e2a\u9488\u811a\u3002\u6240\u6709\u884c\u548c\u5217\u90fd\u8fde\u63a5\u5728\u4e00\u8d77\u7684\u539f\u56e0\u662f\u4e3a\u4e86\u51cf\u5c11\u6240\u9700\u7684\u5f15\u811a\u6570\u3002\u5982\u679c\u4e0d\u662f\u8fd9\u79cd\u60c5\u51b5\uff0c\u90a3\u4e48\u4e00\u4e2a8\u00d78\u70b9\u77e9\u9635\u5355\u5143\u5c06\u9700\u898165\u4e2a\u5f15\u811a\uff0c\u6bcf\u4e2aLED\u4e00\u4e2a\uff0c\u4e00\u4e2a\u516c\u5171\u9633\u6781\u6216\u9634\u6781\u8fde\u63a5\u5668\u3002\u901a\u8fc7\u5c06\u884c\u548c\u5217\u8fde\u63a5\u5728\u4e00\u8d77\uff0c\u4ec5\u9700\u898116\u4e2a\u5f15\u811a\u3002\u8fd9\u79cd\u7528\u8f83\u5c11\u7684\u5f15\u811a\u63a7\u5236\u5927\u91cfLED\u7684\u6280\u672f\u79f0\u4e3a<strong>\u591a\u8def\u590d\u7528\uff08Multiplexing\uff09<\/strong>\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/8x8-Dot-Matrix-Internal-Structure-Multiplexing.png\" alt=\"8x8\u70b9\u9635\u5185\u90e8\u7ed3\u6784\u590d\u7528\"\/><\/figure>\n\n\n\n<p>\u5728\u8fd9\u79cd\u6280\u672f\u4e2d\uff0c\u6bcf\u4e00\u5217\u90fd\u5728\u5f88\u77ed\u7684\u65f6\u95f4\u5185\u88ab\u6fc0\u6d3b\uff0c\u5e76\u4e14\u540c\u65f6\u901a\u8fc7\u5bfb\u5740\u76f8\u5e94\u7684\u884c\u6765\u70b9\u4eae\u8be5\u5217\u4e0a\u7684LED\u3002\u5217\u7684\u5207\u6362\u901f\u5ea6\u975e\u5e38\u5feb\uff08\u6bcf\u79d2\u51e0\u767e\u6216\u6570\u5343\u6b21\uff09\uff0c\u4ee5\u81f3\u4e8e\u4eba\u773c\u7684\u4f59\u8f89\u611f\u77e5\u5230\u663e\u793a\u5c4f\u5df2\u5b8c\u5168\u70b9\u4eae\u3002\u56e0\u6b64\uff0c\u4e00\u6b21\u6700\u591a\u53ea\u80fd\u70b9\u4eae\u516b\u4e2aLED\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/LED-Matrix-Display-Working-Animation-Persistence-of-Vision.gif\" alt=\"led\u77e9\u9635\u663e\u793a\u5de5\u4f5c\u52a8\u753b\u89c6\u89c9\u7684\u6301\u4e45\u6027\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"max7219-chip\">MAX7219\u82af\u7247<\/h3>\n\n\n\n<p>\u5173\u4e8e\u591a\u8def\u590d\u7528\u7684\u70e6\u4eba\u7684\u4e8b\u60c5\u662f\uff0c\u60a8\u9700\u8981\u4f7f\u75288\u4e2a\u529f\u7387\u6676\u4f53\u7ba1\uff0c\u5e76\u4e14\u5fc5\u987b\u4e0d\u65ad\u5237\u65b0\u663e\u793a\u4ee5\u4fdd\u6301\u56fe\u50cf\u7a33\u5b9a\u3002<\/p>\n\n\n\n<p>\u8f93\u5165\u529f\u80fd\u5f3a\u5927\u7684MAX7219\u82af\u7247\uff0c\u5b83\u53ef\u4ee5\u4e3a\u60a8\u5b8c\u6210\u6240\u6709\u63a7\u5236\u548c\u5237\u65b0\u5de5\u4f5c\u3002\u60a8\u6240\u8981\u505a\u7684\u5c31\u662f\u901a\u8fc74\u5f15\u811aSPI\u63a5\u53e3\u53d1\u9001\u4e32\u884c\u547d\u4ee4\uff0c\u5b83\u5c06\u81ea\u52a8\u5904\u7406\u5176\u4f59\u7684\u5de5\u4f5c\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/MAX7219-IC.jpg\" alt=\"MAX7219 IC\"\/><\/figure>\n\n\n\n<p>\u5b83\u53ef\u4ee5\u5b8c\u5168\u63a7\u523664\u4e2a\u5355\u72ec\u7684LED\uff0c\u5305\u62ec\u4fdd\u6301\u76f8\u540c\u7684\u4eae\u5ea6\uff0c\u5e76\u5141\u8bb8\u60a8\u4f7f\u7528\u786c\u4ef6\u6216\u8f6f\u4ef6\uff08\u6216\u4e24\u8005\uff09\u6765\u8c03\u6574LED\u7684\u4eae\u5ea6\u3002\u4e00\u65e6\u663e\u793a\u7531\u5fae\u63a7\u5236\u5668\u66f4\u65b0\uff0cMAX7219\u4fbf\u8d1f\u8d23\u4ee5800 Hz\u5237\u65b0\u663e\u793a\u7684\u6240\u6709\u5de5\u4f5c\u3002\u4ece\u800c\u6d88\u9664\u4e86\u5fae\u63a7\u5236\u5668\u7684\u5f00\u9500\uff0c\u800c\u8fd9\u53ef\u80fd\u4f1a\u505a\u5176\u4ed6\u91cd\u8981\u7684\u4e8b\u60c5\u3002<\/p>\n\n\n\n<p>\u60a8\u751a\u81f3\u53ef\u4ee5\u5728\u8282\u7535\u6a21\u5f0f\u4e0b\u5173\u95ed\u663e\u793a\u5c4f\uff0c\u5e76\u4e14\u5728\u663e\u793a\u5c4f\u5173\u95ed\u65f6\u4ecd\u53ef\u4ee5\u53d1\u9001\u6570\u636e\u3002\u53e6\u4e00\u4e2a\u597d\u5904\u662f\uff0c\u5f00\u673a\u65f6\uff0c\u5b83\u4f1a\u4fdd\u6301LED\u7184\u706d\uff0c\u56e0\u6b64\u5728\u64cd\u4f5c\u7684\u6700\u521d\u51e0\u79d2\u949f\u5185\u4e0d\u4f1a\u51fa\u73b0\u53e4\u602a\u7684\u663e\u793a\u3002<\/p>\n\n\n\n<p>MAX7219\u82af\u7247\u901a\u8fc7SPI\u63a5\u53e3\u8fdb\u884c\u901a\u4fe1\uff0c\u56e0\u6b64\u53ea\u97003\u4e2a\u6570\u636e\u5f15\u811a\u5373\u53ef\u8fde\u63a5\u81f3\u5fae\u63a7\u5236\u5668\uff0c\u6b64\u5916\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u76f8\u540c\u76843\u6839\u7ebf\u5c06\u591a\u4e2a\u6a21\u5757\u83ca\u82b1\u94fe\u5728\u4e00\u8d77\uff0c\u4ee5\u8fdb\u884c\u66f4\u5927\u7684\u663e\u793a\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"setting-maximum-current-and-brightness\">\u8bbe\u7f6e\u6700\u5927\u7535\u6d41\u548c\u4eae\u5ea6<\/h2>\n\n\n\n<p>MAX7219\u82af\u7247\u5141\u8bb8\u60a8\u4f7f\u7528\u786c\u4ef6\u6216\u8f6f\u4ef6\uff08\u6216\u4e24\u8005\uff09\u6765\u8c03\u8282\u663e\u793a\u5668\u7684\u4eae\u5ea6\u3002\u4e3a\u4e86\u5728\u786c\u4ef6\u6c34\u5e73\u4e0a\u8c03\u8282\u4eae\u5ea6\uff0cMAX7219\u8f6c\u63a5\u677f\u5e26\u6709\u4e00\u4e2a\u7535\u963b\uff08RSet\uff09\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/MAX7219-Rset-Resistance-for-Setting-Brightness.jpg\" alt=\"MAX7219 RSET\u7535\u963b\uff0c\u7528\u4e8e\u8bbe\u7f6e\u4eae\u5ea6\"\/><\/figure>\n\n\n\n<p>\u8be5\u7535\u963b\u5668\u8d1f\u8d23\u8bbe\u7f6e\u6d41\u5165LED\u7684\u7535\u6d41\u7684\u4e0a\u9650\uff0c\u4ece\u800c\u8bbe\u7f6e\u663e\u793a\u5668\u7684\u6574\u4f53\u4eae\u5ea6\u3002<\/p>\n\n\n\n<p>\u4e0b\u8868\u663e\u793a\u4e86\u6839\u636eLED\u77e9\u9635\u7684\u7535\u538b\u548c\u6b63\u5411\u7535\u6d41\u5e94\u4f7f\u7528\u7684\u7535\u963b\u5668\u503c\u3002\u4f8b\u5982\uff0c\u5982\u679c\u60a8\u6709\u4e00\u4e2a2V 20 mA LED\uff0c\u5219\u60a8\u7684\u7535\u963b\u503c\u5c06\u4e3a28k\u03a9\uff08\u8be5\u503c\u4ee5k\u03a9\u4e3a\u5355\u4f4d\uff09\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>I&nbsp;<sub>SEG<\/sub>\uff08mA\uff09<\/td><td>V&nbsp;<sub>LED<\/sub>\uff08V\uff09<\/td><\/tr><tr><td>1.5<\/td><td>2.0<\/td><td>2.5<\/td><td>3.0<\/td><td>3.5<\/td><\/tr><tr><td>40<\/td><td>12.2<\/td><td>11.8<\/td><td>11.0<\/td><td>10.6<\/td><td>9.69<\/td><\/tr><tr><td>30<\/td><td>17.8<\/td><td>17.1<\/td><td>15.8<\/td><td>15.0<\/td><td>14.0<\/td><\/tr><tr><td>20<\/td><td>29.8<\/td><td>28.0<\/td><td>25.9<\/td><td>24.5<\/td><td>22.6<\/td><\/tr><tr><td>10<\/td><td>66.7<\/td><td>63.7<\/td><td>59.3<\/td><td>55.4<\/td><td>51.2<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u672c\u6559\u7a0b\u540e\u9762\u5c06\u4ecb\u7ecd\u901a\u8fc7\u8f6f\u4ef6\u8c03\u6574\u4eae\u5ea6\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"max7219-module-pinout\">MAX7219\u6a21\u5757\u5f15\u811a\u6392\u5217<\/h2>\n\n\n\n<p>\u65e0\u8bba\u9009\u62e9\u54ea\u79cd\u6a21\u5757\u7248\u672c\uff0c\u8be5\u6a21\u5757\u4e0a\u90fd\u4f1a\u6709\u4e24\u4e2a\u8fde\u63a5\u5668\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/MAX7219-Dot-Matrix-LED-Display-Module-Pinout.png\" alt=\"MAX7219\u70b9\u77e9\u9635LED\u663e\u793a\u6a21\u5757\u5f15\u811a\u6392\u5217\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"input-connector\">\u8f93\u5165\u63a5\u5934<\/h3>\n\n\n\n<p>\u6a21\u5757\u4e00\u7aef\u7684\u4e2d\u65ad\u5f15\u811a\u7528\u4e8e\u4e0e\u5fae\u63a7\u5236\u5668\u901a\u4fe1\u3002<\/p>\n\n\n\n<p>VCC\u8fde\u63a5\u52305V\u3002\u7531\u4e8e\u663e\u793a\u5668\u7684\u9ad8\u7535\u6d41\u6d88\u8017\uff08\u5982\u679c\u4eae\u5ea6\u4e00\u76f4\u5347\u9ad8\uff0c\u6700\u9ad8\u53ef\u8fbe1A\uff09\uff0c\u5efa\u8bae\u76f4\u63a5\u4ece\u5916\u90e8\u7535\u6e90\u8fd0\u884c\uff0c\u800c\u4e0d\u662f\u4eceArduino\u76845V\u7535\u6e90\u8fd0\u884c\u3002\u5426\u5219\uff0c\u8bf7\u786e\u4fdd\u5c06\u4eae\u5ea6\u4fdd\u6301\u572850\uff05\u4ee5\u4e0b\uff0c\u4ee5\u4f7fArduino\u7684\u7a33\u538b\u5668\u4e0d\u4f1a\u8fc7\u70ed\u3002<\/p>\n\n\n\n<p>\u5730\u7ebf&nbsp;\u8fde\u63a5\u5230\u5171\u540c\u70b9\u3002<\/p>\n\n\n\n<p>DIN\u6807\u51c6\u662f\u6570\u636e\u8f93\u5165\u3002\u5c06\u5176\u8fde\u63a5\u5230\u5fae\u63a7\u5236\u5668\u7684\u4efb\u4f55\u6570\u5b57\u5f15\u811a\u3002<\/p>\n\n\n\n<p>CS \/\u8d1f\u8f7d\u662f\u7247\u9009\uff08\u6709\u65f6\u6807\u8bb0\u4e3aLOAD\uff09\u3002\u5c06\u5176\u8fde\u63a5\u5230\u5fae\u63a7\u5236\u5668\u7684\u4efb\u4f55\u6570\u5b57\u5f15\u811a\u3002<\/p>\n\n\n\n<p>\u65f6\u949f\u662f\u65f6\u949f\u5f15\u811a\u3002\u5c06\u5176\u8fde\u63a5\u5230\u5fae\u63a7\u5236\u5668\u7684\u4efb\u4f55\u6570\u5b57\u5f15\u811a\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"output-connector\">\u8f93\u51fa\u63a5\u5934<\/h3>\n\n\n\n<p>\u5f53\u60a8\u60f3\u4ee5\u83ca\u82b1\u94fe\u65b9\u5f0f\u8fde\u63a5\u663e\u793a\u5668\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u6a21\u5757\u53e6\u4e00\u7aef\u7684\u5206\u65ad\u9500\u3002<\/p>\n\n\n\n<p>VCC&nbsp;\u8fde\u63a5\u5230\u4e0b\u4e00\u4e2a\u6a21\u5757\u4e0a\u76845V\u3002<\/p>\n\n\n\n<p>\u5730\u7ebf&nbsp;\u8fde\u63a5\u5230\u4e0b\u4e00\u4e2a\u6a21\u5757\u7684GND\u3002<\/p>\n\n\n\n<p>DOUT&nbsp;\u662f\u6570\u636e\u8f93\u51fa\uff0c\u5e76\u8fde\u63a5\u5230\u4e0b\u4e00\u4e2a\u6a21\u5757\u7684DIN\u5f15\u811a\u3002<\/p>\n\n\n\n<p>CS \/\u8d1f\u8f7d&nbsp;\u8fde\u63a5\u5230\u4e0b\u4e00\u4e2a\u6a21\u5757\u4e0a\u7684CS \/ LOAD\u3002<\/p>\n\n\n\n<p>\u65f6\u949f&nbsp;\u8fde\u63a5\u5230\u4e0b\u4e00\u4e2a\u6a21\u5757\u4e0a\u7684CLK\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"wiring-max7219-module-with-arduino-uno\">\u7528Arduino UNO\u63a5\u7ebfMAX7219\u6a21\u5757<\/h2>\n\n\n\n<p>\u65e2\u7136\u6211\u4eec\u4e86\u89e3\u4e86\u6709\u5173\u6a21\u5757\u7684\u6240\u6709\u77e5\u8bc6\uff0c\u5c31\u53ef\u4ee5\u5f00\u59cb\u5c06\u5176\u8fde\u63a5\u5230Arduino\u4e86\uff01<\/p>\n\n\n\n<p>\u9996\u5148\uff0c\u4e3a\u6a21\u5757\u4f9b\u7535\u3002\u56e0\u4e3a\u663e\u793a\u5c4f\u6d88\u8017\u5927\u91cf\u7535\u6d41\uff0c\u6240\u4ee5\u6211\u4eec\u5c06\u901a\u8fc7\u5916\u90e8\u7535\u6e90\u800c\u4e0d\u662fArduino\u677f\u76845V\u7535\u6e90\u8fd0\u884c\u6a21\u5757\u3002\u5982\u679c\u8981\u4f7f\u7528\u5355\u4e2aMAX7219\u6a21\u5757\uff0c\u5219\u53ef\u4ee5\u76f4\u63a5\u4eceArduino\u7ed9\u6a21\u5757\u4f9b\u7535\uff0c\u4f46\u662f\u5982\u679c\u53ef\u4ee5\u7684\u8bdd\uff0c\u8bf7\u907f\u514d\u4f7f\u7528\u5b83\u3002<\/p>\n\n\n\n<p>\u73b0\u5728\uff0c\u6211\u4eec\u53ea\u5269\u4e0b\u7528\u4e8eSPI\u901a\u4fe1\u7684\u5f15\u811a\u4e86\u3002\u7531\u4e8eMAX7219\u6a21\u5757\u9700\u8981\u5927\u91cf\u6570\u636e\u4f20\u8f93\uff0c\u56e0\u6b64\u5f53\u8fde\u63a5\u81f3\u5fae\u63a7\u5236\u5668\u4e0a\u7684\u786c\u4ef6SPI\u5f15\u811a\u65f6\uff0c\u5b83\u5c06\u63d0\u4f9b\u6700\u4f73\u6027\u80fd\u3002\u786c\u4ef6SPI\u5f15\u811a\u6bd4\u8f6f\u4ef6SPI\u5feb\u5f97\u591a\u3002<\/p>\n\n\n\n<p>\u8bf7\u6ce8\u610f\uff0c\u6bcf\u4e2aArduino\u5f00\u53d1\u677f\u90fd\u6709\u4e0d\u540c\u7684SPI\u5f15\u811a\uff0c\u5e94\u76f8\u5e94\u8fde\u63a5\u3002\u5bf9\u4e8e\u8bf8\u5982UNO \/ Nano V3.0\u4e4b\u7c7b\u7684Arduino\u677f\uff0c\u8fd9\u4e9b\u5f15\u811a\u4e3a\u6570\u5b5713\uff08SCK\uff09\uff0c12\uff08MISO\uff09\uff0c11\uff08MOSI\uff09\u548c10\uff08SS\uff09\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u60a8\u4f7f\u7528\u5176\u4ed6Arduino\u677f\uff0c\u5efa\u8bae\u5728\u7ee7\u7eed\u4e4b\u524d\u68c0\u67e5\u6709\u5173\u201c&nbsp;<a href=\"https:\/\/www.arduino.cc\/en\/reference\/SPI\">SPI\u5f15\u811a\u4f4d\u7f6e<\/a>\u201d\u7684\u5b98\u65b9\u6587\u6863\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u662f\u901a\u7528MAX7219\u6a21\u5757\u7684\u5b9e\u9a8c\u8fde\u63a5\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/Wiring-Generic-MAX7219-LED-Display-Module-with-Arduino.png\" alt=\"\u63a5\u7ebf\u901a\u7528MAX7219 LED\u663e\u793a\u6a21\u5757\u548cArduino\"\/><\/figure>\n\n\n\n<p>\u4ee5\u4e0b\u662fFC-16 MAX7219\u6a21\u5757\u7684\u8fde\u63a5\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/Wiring-FC16-MAX7219-LED-Display-Module-with-Arduino.png\" alt=\"\u63a5\u7ebf\u5e26\u6709Arduino\u7684FC16 MAX7219 LED\u663e\u793a\u6a21\u5757\"\/><\/figure>\n\n\n\n<p>\u5982\u679c\u8981\u4ee5\u83ca\u82b1\u94fe\u65b9\u5f0f\u8fde\u63a5\u591a\u4e2a\u663e\u793a\u5668\u4ee5\u521b\u5efa\u66f4\u5927\u7684\u663e\u793a\u5668\uff0c\u8bf7\u5c06\u7b2c\u4e00\u4e2a\u663e\u793a\u5668\u7684DOUT\u8fde\u63a5\u5230\u4e0b\u4e00\u4e2a\u663e\u793a\u5668\u7684DIN\u3002VCC\uff0cGND\uff0cCLK\u548cCS\u5c06\u5728\u663e\u793a\u5668\u4e4b\u95f4\u5171\u4eab\u3002<\/p>\n\n\n\n<p>\u4e00\u65e6\u60a8\u7684\u6a21\u5757\u8fde\u63a5\u5230Arduino\uff0c\u5c31\u8be5\u7f16\u5199\u4e00\u4e9b\u4ee3\u7801\u4e86\uff01<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"library-installation\">\u5e93\u5b89\u88c5<\/h2>\n\n\n\n<p>\u63a7\u5236MAX7219\u6a21\u5757\u9700\u8981\u5927\u91cf\u5de5\u4f5c\u3002\u5e78\u8fd0\u7684\u662f\uff0c\u7f16\u5199\u4e86MD_Parola\u5e93\u6765\u9690\u85cfMAX7219\u7684\u590d\u6742\u6027\uff0c\u4ee5\u4fbf\u6211\u4eec\u53ef\u4ee5\u53d1\u51fa\u7b80\u5355\u7684\u547d\u4ee4\u6765\u63a7\u5236\u663e\u793a\u3002<\/p>\n\n\n\n<p>\u8981\u5b89\u88c5\u5e93\uff0c\u8bf7\u5bfc\u822a\u81f3\u201c<strong>\u8349\u56fe\u201d&gt;\u201c\u5305\u542b\u5e93\u201d&gt;\u201c\u7ba1\u7406\u5e93&#8230;\u201d\uff0c<\/strong>\u7b49\u5f85\u5e93\u7ba1\u7406\u5668\u4e0b\u8f7d\u5e93\u7d22\u5f15\u5e76\u66f4\u65b0\u5df2\u5b89\u88c5\u5e93\u7684\u5217\u8868\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/Manage-Libraries.png\" alt=\"Arduino\u5e93\u5b89\u88c5-\u5728Arduino IDE\u4e2d\u9009\u62e9\u7ba1\u7406\u5e93\"\/><\/figure>\n\n\n\n<p>\u8f93\u5165\u201c&nbsp;<strong>max72xx<\/strong>&nbsp;\u201d\u8fc7\u6ee4\u641c\u7d22\u3002\u5e94\u8be5\u6709\u51e0\u4e2a\u6761\u76ee\u3002\u5bfb\u627e<strong>MajicDesigns<\/strong>\u7684<strong>MD_MAX72XX<\/strong>\u3002\u5355\u51fb\u8be5\u6761\u76ee\uff0c\u7136\u540e\u9009\u62e9\u201c\u5b89\u88c5\u201d\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/MD_MAX72XX-Library-Installation.png\" alt=\"md_max72xx\u5e93\u5b89\u88c5\"\/><\/figure>\n\n\n\n<p>\u8be5MD_MAX72XX\u5e93\u662f\u7279\u5b9a\u4e8e\u786c\u4ef6\u7684\u5e93\uff0c\u7528\u4e8e\u5904\u7406\u8f83\u4f4e\u7ea7\u522b\u7684\u529f\u80fd\u3002\u5b83\u9700\u8981\u4e0e<strong>MD_Parola<\/strong>\u5e93\u914d\u5bf9\u624d\u80fd\u521b\u5efa\u8bb8\u591a\u4e0d\u540c\u7684\u6587\u672c\u52a8\u753b\uff0c\u4f8b\u5982\u6eda\u52a8\u548c\u7cbe\u7075\u6587\u672c\u6548\u679c\u3002\u4e5f\u5b89\u88c5\u6b64\u5e93\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/MD_Parola-Library-Installation.png\" alt=\"md_parola\u5e93\u5b89\u88c5\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"basic-arduino-code-printing-text\">\u57fa\u672c\u7684Arduino\u4ee3\u7801\u2013\u6253\u5370\u6587\u672c<\/h2>\n\n\n\n<p>\u5bf9\u4e8e\u6211\u4eec\u7684\u7b2c\u4e00\u4e2a\u5b9e\u9a8c\uff0c\u6211\u4eec\u5c06\u5728\u663e\u793a\u5668\u4e0a\u6253\u5370\u4e00\u4e2a\u6ca1\u6709\u4efb\u4f55\u52a8\u753b\u7684\u7b80\u5355\u6587\u672c\u3002<\/p>\n\n\n\n<p>\u4f46\u662f\u5728\u7ee7\u7eed\u4e0a\u8f7d\u8349\u56fe\u4e4b\u524d\uff0c\u60a8\u9700\u8981\u8fdb\u884c\u4e00\u4e9b\u66f4\u6539\u4ee5\u4f7f\u5176\u9002\u5408\u60a8\u3002\u60a8\u5fc5\u987b\u4fee\u6539\u4ee5\u4e0b\u4e24\u4e2a\u53d8\u91cf\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/Changes-to-make.png\" alt=\"\u505a\u51fa\u6539\u53d8\"\/><\/figure>\n\n\n\n<p>\u7b2c\u4e00\u4e2a\u53d8\u91cf<code>HARDWARE_TYPE<\/code>\u544a\u8bc9arduino\u60a8\u6b63\u5728\u4f7f\u7528\u54ea\u4e2a\u7248\u672c\u7684\u6a21\u5757\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u5982\u679c\u4f7f\u7528\u7684\u6a21\u5757\u901a\u5e38\u5e26\u6709\u7eff\u8272PCB\u548c\u901a\u5b54MAX7219 IC\uff0c\u5219\u5c06\u8bbe\u7f6e<code>HARDWARE_TYPE<\/code>\u4e3a<code>GENERIC_HW<\/code>\uff0c\u5982\u4e0b\u6240\u793a\u3002<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/MAX7219-Generic-Module.jpg\" alt=\"max7219\u901a\u7528\u6a21\u5757\" width=\"200\" height=\"110\"><\/li><li>\u5982\u679c\u4f7f\u7528\u7684\u6a21\u5757\u901a\u5e38\u5e26\u6709\u84dd\u8272PCB\u548cSMD MAX7219 IC\uff0c\u5219\u5c06\u8bbe\u7f6e<code>HARDWARE_TYPE<\/code>\u4e3a<code>FC16_HW<\/code>\uff0c\u5982\u4e0b\u6240\u793a\u3002<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/MAX7219-FC-16-Module.jpg\" alt=\"MAX7219 FC 16\u6a21\u5757\" width=\"222\" height=\"110\"><\/li><\/ul>\n\n\n\n<p>\u4f7f\u7528\u7b2c\u4e8c\u4e2a\u53d8\u91cf\uff0c<code>MAX_DEVICES<\/code>\u8bbe\u7f6e\u8981\u4f7f\u7528\u76848\u00d78\u70b9\u77e9\u9635\u663e\u793a\u7684\u6570\u91cf\u30028\u00d78\u77e9\u9635\u8ba1\u4e3a1\u4e2a\u8bbe\u5907\uff0c\u56e0\u6b64\uff0c\u5982\u679c\u8981\u63a7\u52368\u00d732\u6a21\u5757\uff0c\u5fc5\u987b\u5c06\u5176\u8bbe\u7f6e<code>MAX_DEVICES<\/code>\u4e3a4\uff088\u00d732\u663e\u793a\u5c4f\u5305\u542b4\u4e2aMAX7219 IC\uff09\u3002<\/p>\n\n\n\n<p>\u5b8c\u6210\u540e\uff0c\u7ee7\u7eed\u5c1d\u8bd5\u8349\u56fe\uff0c\u7136\u540e\u6211\u4eec\u5c06\u5bf9\u5176\u8fdb\u884c\u8be6\u7ec6\u5256\u6790\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ Including the required Arduino libraries\n#include &lt;MD_Parola.h>\n#include &lt;MD_MAX72xx.h>\n#include &lt;SPI.h>\n\n\/\/ Uncomment according to your hardware type\n#define HARDWARE_TYPE MD_MAX72XX::FC16_HW\n\/\/#define HARDWARE_TYPE MD_MAX72XX::GENERIC_HW\n\n\/\/ Defining size, and output pins\n#define MAX_DEVICES 4\n#define CS_PIN 3\n\n\/\/ Create a new instance of the MD_Parola class with hardware SPI connection\nMD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);\n\nvoid setup() {\n\t\/\/ Intialize the object\n\tmyDisplay.begin();\n\n\t\/\/ Set the intensity (brightness) of the display (0-15)\n\tmyDisplay.setIntensity(0);\n\n\t\/\/ Clear the display\n\tmyDisplay.displayClear();\n}\n\nvoid loop() {\n\tmyDisplay.setTextAlignment(PA_LEFT);\n\tmyDisplay.print(\"Left\");\n\tdelay(2000);\n\t\n\tmyDisplay.setTextAlignment(PA_CENTER);\n\tmyDisplay.print(\"Center\");\n\tdelay(2000);\n\n\tmyDisplay.setTextAlignment(PA_RIGHT);\n\tmyDisplay.print(\"Right\");\n\tdelay(2000);\n\n\tmyDisplay.setTextAlignment(PA_CENTER);\n\tmyDisplay.setInvert(true);\n\tmyDisplay.print(\"Invert\");\n\tdelay(2000);\n\n\tmyDisplay.setInvert(false);\n\tmyDisplay.print(1234);\n\tdelay(2000);\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"output\">\u8f93\u51fa<\/h3>\n\n\n\n<p>\u4e0a\u8f7d\u8349\u56fe\u540e\uff0c\u5fc5\u987b\u6b63\u786e\u8c03\u6574\u663e\u793a\u7684\u65b9\u5411\u624d\u80fd\u770b\u5230\u8f93\u51fa\u3002\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f\u901a\u7528\u6a21\u5757\uff0c\u8bf7\u8c03\u6574\u5176\u65b9\u5411\uff0c\u4f7fMAX7219 IC\u4f4d\u4e8e\u9876\u90e8\u3002\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662fFC-16\u6a21\u5757\uff0c\u8bf7\u8c03\u6574\u5176\u65b9\u5411\uff0c\u4ee5\u4f7fDIN\u4fa7\u4fdd\u6301\u5728\u53f3\u4fa7\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u4e00\u5207\u987a\u5229\uff0c\u60a8\u5c06\u770b\u5230\u4ee5\u4e0b\u8f93\u51fa\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/MAX7219-LED-Display-Arduino-Text-Output.gif\" alt=\"MAX7219 LED\u663e\u793a\u5c4fArduino\u6587\u672c\u8f93\u51fa\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"code-explanation\">\u4ee3\u7801\u8bf4\u660e<\/h3>\n\n\n\n<p>\u7b2c\u4e00\u6b65\u662f\u5305\u62ec\u6240\u6709\u5fc5\u9700\u7684Arduino\u5e93\u3002\u5982\u524d\u6240\u8ff0\uff0cMD_MAX72XX\u5e93\u5b9e\u73b0LED\u77e9\u9635\u7684\u786c\u4ef6\u7279\u5b9a\u529f\u80fd\uff0c\u800cMD_Parola\u5e93\u5b9e\u73b0\u6587\u672c\u6548\u679c\u3002\u60a8\u8fd8\u5fc5\u987b\u5305\u62ecSPI\u5e93\uff0c\u8be5\u5e93\u5df2\u9884\u5148\u5b89\u88c5\u5728Arduino IDE\u4e2d\u3002\u8be5\u5e93\u7528\u4e8e\u901a\u8fc7SPI\u5728\u663e\u793a\u5668\u548cArduino\u4e4b\u95f4\u8fdb\u884c\u901a\u4fe1\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#include &lt;MD_Parola.h>\n#include &lt;MD_MAX72xx.h>\n#include &lt;SPI.h><\/pre>\n\n\n\n<p>\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u9700\u8981\u6307\u5b9a\u6b63\u5728\u4f7f\u7528\u7684\u786c\u4ef6\u3002\u7531\u4e8e\u6211\u4eec\u5728\u5b9e\u9a8c\u4e2d\u4f7f\u7528\u7684\u662fFC-16\u6a21\u5757\uff0c\u56e0\u6b64<code>HARDWARE_TYPE<\/code>\u5c06\u8bbe\u7f6e\u4e3a<code>FC16_HW<\/code>\u3002\u6211\u4eec\u4f7f\u7528\u7684MAX7219 IC\u6570\u91cf\u4e3a4\uff0c\u56e0\u6b64<code>MAX_DEVICES<\/code>\u8bbe\u7f6e\u4e3a4\u3002\u6700\u540e\uff0c\u5b9a\u4e49\u4e86\u663e\u793a\u5668\u7684CS\u5f15\u811a\u6240\u8fde\u63a5\u7684\u5f15\u811a\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#define HARDWARE_TYPE MD_MAX72XX::FC16_HW\n#define MAX_DEVICES 4\n#define CS_PIN 3<\/pre>\n\n\n\n<p>\u63a5\u4e0b\u6765\uff0c\u4f7f\u7528\u51fd\u6570\u521b\u5efaMD_Parola\u7c7b\u7684\u65b0\u5b9e\u4f8b<code>MD_Parola()<\/code>\u3002\u6b64\u529f\u80fd\u9700\u8981\u4e09\u4e2a\u53c2\u6570\uff0c\u7b2c\u4e00\u4e2a\u662f\u786c\u4ef6\u7c7b\u578b\uff0c\u7b2c\u4e8c\u4e2a\u662fCS\u5f15\u811a\uff0c\u7b2c\u4e09\u4e2a\u662f\u6700\u5927\u8fde\u63a5\u8bbe\u5907\u6570\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);<\/pre>\n\n\n\n<p>\u5728\u4ee3\u7801\u7684\u8bbe\u7f6e\u90e8\u5206\uff0c\u6211\u4eec\u9996\u5148\u4f7f\u7528\u51fd\u6570\u521d\u59cb\u5316\u5bf9\u8c61<code>begin()<\/code>\u3002\u663e\u793a\u5c4f\u7684\u4eae\u5ea6\u53ef\u4ee5\u901a\u8fc7\u529f\u80fd\u8fdb\u884c\u8bbe\u7f6e<code>setIntensity()<\/code>\u3002\u60a8\u53ef\u4ee5\u8f93\u5165\u4ecb\u4e8e0\uff08\u6700\u5c0f\u4eae\u5ea6\uff09\u548c15\uff08\u6700\u5927\u4eae\u5ea6\uff09\u4e4b\u95f4\u7684\u503c\u3002\u8be5\u529f\u80fd<code>displayClear()<\/code>\u6e05\u9664\u663e\u793a\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">void setup() {\n  myDisplay.begin();\n  myDisplay.setIntensity(0);\n  myDisplay.displayClear();\n}<\/pre>\n\n\n\n<p>\u5728\u4ee3\u7801\u7684\u5faa\u73af\u90e8\u5206\u4e2d\uff0c\u6211\u4eec\u9996\u5148\u4f7f\u7528\u51fd\u6570\u8bbe\u7f6e\u8981\u6253\u5370\u7684\u6587\u672c\u7684\u5bf9\u9f50\u65b9\u5f0f<code>setTextAlignment()<\/code>\u3002\u60a8\u53ef\u4ee5\u5de6\uff0c\u4e2d\uff0c\u53f3\u5bf9\u9f50\u6587\u672c\u7528<code>PA_LEFT<\/code>\uff0c<code>PA_CENTER<\/code>\u548c<code>PA_RIGHT<\/code>\u5206\u522b\u3002<\/p>\n\n\n\n<p>\u63a5\u4e0b\u6765\uff0c\u5b57\u7b26\u4e32&#8217;Left&#8217;\u5370\u6709<code>myDisplay.print(\"Left\")<\/code>\u3002\u8bf7\u6ce8\u610f\uff0c<strong><code>\" \"<\/code><\/strong>\u7531\u4e8e\u6211\u4eec\u6b63\u5728\u6253\u5370\u6587\u672c\u5b57\u7b26\u4e32\uff0c\u56e0\u6b64\u9700\u8981\u5728\u6587\u672c\u5468\u56f4\u52a0\u4e0a\u5f15\u53f7\u3002\u5f53\u60a8\u8981\u6253\u5370\u6570\u5b57\u65f6\uff0c\u4e0d\u9700\u8981\u5f15\u53f7\u3002\u4e3e\u4e2a\u4f8b\u5b50<code>myDisplay.print(1234)<\/code>\u3002\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528\u529f\u80fd\u53cd\u8f6c\u663e\u793a<code>setInvert()<\/code>\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">void loop() {\n\tmyDisplay.setTextAlignment(PA_LEFT);\n\tmyDisplay.print(\"Left\");\n\tdelay(2000);\n\t\n\tmyDisplay.setTextAlignment(PA_CENTER);\n\tmyDisplay.print(\"Center\");\n\tdelay(2000);\n\n\tmyDisplay.setTextAlignment(PA_RIGHT);\n\tmyDisplay.print(\"Right\");\n\tdelay(2000);\n\n\tmyDisplay.setTextAlignment(PA_CENTER);\n\tmyDisplay.setInvert(true);\n\tmyDisplay.print(\"Invert\");\n\tdelay(2000);\n\n\tmyDisplay.setInvert(false);\n\tmyDisplay.print(1234);\n\tdelay(2000);\n}<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"arduino-code-scrolling-text\">Arduino\u4ee3\u7801\u2013\u6eda\u52a8\u6587\u672c<\/h2>\n\n\n\n<p>\u5f53\u60a8\u60f3\u5728\u70b9\u77e9\u9635\u663e\u793a\u5668\u4e0a\u6253\u5370\u6d88\u606f\u65f6\uff0c\u901a\u5e38\u4f1a\u53d1\u73b0\u8be5\u663e\u793a\u5668\u592a\u5c0f\u800c\u65e0\u6cd5\u5bb9\u7eb3\u6574\u4e2a\u6d88\u606f\u3002\u89e3\u51b3\u65b9\u6848\u662f\u4f7f\u7528\u6eda\u52a8\u6587\u672c\u6548\u679c\u3002\u4ee5\u4e0b\u793a\u4f8b\u663e\u793a\u4e86\u5982\u4f55\u6eda\u52a8\u6d88\u606f\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/ Including the required Arduino libraries\n#include &lt;MD_Parola.h>\n#include &lt;MD_MAX72xx.h>\n#include &lt;SPI.h>\n\n\/\/ Uncomment according to your hardware type\n#define HARDWARE_TYPE MD_MAX72XX::FC16_HW\n\/\/#define HARDWARE_TYPE MD_MAX72XX::GENERIC_HW\n\n\/\/ Defining size, and output pins\n#define MAX_DEVICES 4\n#define CS_PIN 3\n\n\/\/ Create a new instance of the MD_Parola class with hardware SPI connection\nMD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);\n\nvoid setup() {\n\t\/\/ Intialize the object\n\tmyDisplay.begin();\n\n\t\/\/ Set the intensity (brightness) of the display (0-15)\n\tmyDisplay.setIntensity(0);\n\n\t\/\/ Clear the display\n\tmyDisplay.displayClear();\n\n\tmyDisplay.displayScroll(\"Hello\", PA_CENTER, PA_SCROLL_LEFT, 100);\n}\n\nvoid loop() {\n\tif (myDisplay.displayAnimate()) {\n\t\tmyDisplay.displayReset();\n\t}\n}<\/pre>\n\n\n\n<p>\u5982\u679c\u4e00\u5207\u6b63\u5e38\uff0c\u60a8\u5c06\u770b\u5230\u4ee5\u4e0b\u8f93\u51fa\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lastminuteengineers.com\/wp-content\/uploads\/arduino\/MAX7219-LED-Display-Arduino-Scrolling-Output.gif\" alt=\"MAX7219 LED\u663e\u793a\u5c4farduino\u6eda\u52a8\u8f93\u51fa\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"code-explanation\">\u4ee3\u7801\u8bf4\u660e<\/h3>\n\n\n\n<p>\u60a8\u4f1a\u6ce8\u610f\u5230\uff0c\u8bbe\u7f6e\u90e8\u5206\u672b\u5c3e\u7684\u4ee3\u7801\u7684\u7b2c\u4e00\u90e8\u5206\u4e0e\u524d\u9762\u7684\u793a\u4f8b\u5b8c\u5168\u76f8\u540c\u3002\u5728\u8bbe\u7f6e\u90e8\u5206\u7684\u672b\u5c3e\uff0c\u5c06<code>displayScroll()<\/code>\u4f7f\u7528\u8be5\u529f\u80fd\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">myDisplay.displayScroll(\"Hello\", PA_CENTER, PA_SCROLL_LEFT, 100);<\/pre>\n\n\n\n<p>\u5982\u60a8\u6240\u89c1\uff0c\u6b64\u51fd\u6570\u91c7\u7528\u56db\u4e2a\u53c2\u6570\uff1a<strong>displayScroll\uff08pText\uff0calign\uff0ctextEffect\uff0cspeed\uff09<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>pText<\/code>\u2013\u662f\u6587\u672c\u5b57\u7b26\u4e32\u3002\u60a8\u7684\u7559\u8a00\u5728\u8fd9\u91cc\u3002<\/li><li><code>align<\/code>\u2013\u8bbe\u7f6e\u53ef\u9009\u6682\u505c\u671f\u95f4\u7684\u6587\u672c\u5bf9\u9f50\u65b9\u5f0f\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4e0e\u4e0a\u4e00\u4e2a\u793a\u4f8b\u76f8\u540c\u7684\u5bf9\u9f50\u9009\u9879\uff0c\u4f8b\u5982PA_CENTER\uff0cPA_LEFT\u6216PA_RIGHT\u3002<\/li><li><code>textEffect<\/code>\u2013\u6307\u5b9a\u6eda\u52a8\u6548\u679c\u3002\u5c06\u5176\u8bbe\u7f6e\u4e3aPA_SCROLL_LEFT\u5c06\u5411\u5de6\u6eda\u52a8\u6587\u672c\u3002<\/li><li><code>speed<\/code>-\u786e\u5b9a\u52a8\u753b\u7684\u901f\u5ea6\u3002\u901f\u5ea6\u662f\u52a8\u753b\u5e27\u4e4b\u95f4\u7684\u65f6\u95f4\uff08\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d\uff09\u3002\u65f6\u95f4\u77ed\u53ef\u52a0\u5feb\u52a8\u753b\u64ad\u653e\u901f\u5ea6\u3002<\/li><\/ul>\n\n\n\n<p>\u9664\u6b64\u4e4b\u5916\uff0c\u5728\u5faa\u73af\u90e8\u5206\u4e2d\uff0c\u4ec5\u4f7f\u7528\u4e24\u4e2a\u51fd\u6570\u6765\u521b\u5efa\u6eda\u52a8\u6587\u672c\u3002\u9996\u5148\uff0c\u6211\u4eec<code>displayAnimate()<\/code>\u5728<code>if<\/code>\u8bed\u53e5\u4e2d\u4f7f\u7528\u8be5\u51fd\u6570\u3002\u6b64\u51fd\u6570\u6eda\u52a8\u6587\u672c\uff0c\u5e76\u5728\u6eda\u52a8\u5b8c\u6210\u540e\u8fd4\u56detrue\u3002\u6eda\u52a8\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u4f7f\u7528\u529f\u80fd\u91cd\u7f6e\u663e\u793a<code>displayReset()<\/code>\uff0c\u4ee5\u4fbf\u6211\u4eec\u8fde\u7eed\u6eda\u52a8\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">void loop() {\n\tif (myDisplay.displayAnimate()) {\n\t\tmyDisplay.displayReset();\n\t}\n}<\/pre>\n\n\n\n<p>\u6709\u5173\u5176\u4ed6\u6587\u672c\u6548\u679c\uff0c\u8bf7\u8bbf\u95eegithub\u4e0a\u7684<a href=\"https:\/\/majicdesigns.github.io\/MD_Parola\/class_m_d___parola.html\">MD_Parola\u5e93\u53c2\u8003<\/a>\u3002<\/p>\n\n\n\n<p>rreference\uff1a<\/p>\n\n\n\n<p><blockquote class=\"wp-embedded-content\" data-secret=\"zsQ6RPbXpk\"><a href=\"https:\/\/lastminuteengineers.com\/max7219-dot-matrix-arduino-tutorial\/\">Interfacing MAX7219 LED Dot Matrix Display with Arduino<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Interfacing MAX7219 LED Dot Matrix Display with Arduino&#8221; &#8212; Last Minute Engineers\" src=\"https:\/\/lastminuteengineers.com\/max7219-dot-matrix-arduino-tutorial\/embed\/#?secret=zsQ6RPbXpk\" data-secret=\"zsQ6RPbXpk\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fdf\u65e9\uff0cArduino\u53d1\u70e7\u53cb\u603b\u662f\u4f1a\u9047\u5230\u70b9\u77e9\u9635\u663e\u793a\u3002\u5b83\u662f\u4e8c\u7ef4\u56fe\u6848\u5316\u7684LED\u9635\u5217\uff0c\u7528\u4e8e\u8868\u793a\u5b57\u7b26\uff0c\u7b26\u53f7\u548c\u56fe\u50cf\u3002\u51e0\u4e4e\u6240\u6709 &hellip; <a href=\"http:\/\/mgspace.wiki\/docs\/?docs=88%e7%82%b9%e9%98%b5%e5%b1%8f\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c8*8\u70b9\u9635\u5c4f\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[34],"doc_tag":[],"class_list":["post-1517","docs","type-docs","status-publish","hentry","doc_category-coding"],"_links":{"self":[{"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=\/wp\/v2\/docs\/1517","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1517"}],"version-history":[{"count":2,"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=\/wp\/v2\/docs\/1517\/revisions"}],"predecessor-version":[{"id":1520,"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=\/wp\/v2\/docs\/1517\/revisions\/1520"}],"wp:attachment":[{"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1517"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_category&post=1517"},{"taxonomy":"doc_tag","embeddable":true,"href":"http:\/\/mgspace.wiki\/docs\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=1517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}