{"id":15301,"date":"2022-05-03T12:10:00","date_gmt":"2022-05-03T04:10:00","guid":{"rendered":"https:\/\/www.circuspi.com\/?p=15301"},"modified":"2022-05-20T15:22:49","modified_gmt":"2022-05-20T07:22:49","slug":"pixelbit-unit4","status":"publish","type":"post","link":"https:\/\/www.circuspi.com\/index.php\/2022\/05\/03\/pixelbit-unit4\/","title":{"rendered":"Pixel:Bit \u6559\u5b78(\u56db)\uff0d\u5982\u4f55\u5c07\u5f71\u50cf\u4e32\u6d41\u5230 TFT ?"},"content":{"rendered":"\n<p><style>\n\/* ###\u5be6\u9a57\u4e0b\u4e00\u5217### *\/\n\na:link {color:#0695e4\n;}    \/* \u8a2d\u5b9a\u5c1a\u672a\u9ede\u95b1\u904e\u7684\u9023\u7d50\u6a23\u5f0f *\/\na:visited {color:#0695e4\n;} \/* \u8a2d\u5b9a\u904e\u53bb\u66fe\u7d93\u95b1\u904e\u7684\u9023\u7d50 *\/\na:hover {color:#0695e4\n;}   \/* \u8a2d\u5b9a\u6ed1\u9f20\u6e38\u6a19\u6307\u5728\u9023\u7d50\u4f4d\u7f6e\u4e0a\u7684\u6a23\u5f0f *\/\na:active {color:#0000BB;}  \/* \u8a2d\u5b9a\u4e0a\u9ede\u64ca\u904e\u7684\u9023\u7d50\u6a23\u5f0f *\/\n<\/style><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"526\" src=\"https:\/\/www.circuspi.com\/wp-content\/uploads\/2022\/05\/1000x526.jpg\" alt=\"\" class=\"wp-image-15782\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e00\u3001\u7c21\u4ecb<\/h2>\n\n\n\n<p>\u5728 <a href=\"https:\/\/www.circuspi.com\/index.php\/category\/technical-articles\/pixelbit-%e7%b3%bb%e5%88%97\/\" target=\"_blank\" rel=\"noreferrer noopener\">Pixel:Bit \u6559\u5b78(\u4e00)~(\u4e09)<\/a> \u4e2d\u6211\u5011\u5b78\u6703\u4e86\u5982\u4f55\u4f7f\u7528 TFT \u4e2d\u986f\u793a\u6587\u5b57\uff0c\u6216\u8005\u662f\u5c07\u5f71\u50cf\u900f\u904e Web Server \u7684\u65b9\u5f0f\u5448\u73fe\u5728\u7db2\u9801\u4e0a\uff0c\u5728\u9019\u500b\u55ae\u5143\u6211\u5011\u5c07\u9032\u4e00\u6b65\u7d50\u5408\u9019\u5169\u9805\u61c9\u7528\uff0c\u6539\u900f\u904e TFT \u986f\u793a Camera \u5f71\u50cf\u756b\u9762\uff0c\u904e\u7a0b\u4e2d\u53ea\u9700\u8981\u5e7e\u500b\u6b65\u9a5f\u5c31\u53ef\u4ee5\u5feb\u901f\u5b8c\u6210\u9019\u500b\u61c9\u7528\u5594\uff01<\/p>\n\n\n\n<p>\u958b\u59cb\u64cd\u4f5c\u4e4b\u524d\uff0c\u8acb\u5404\u4f4d\u6e96\u5099\u597d\u4ee5\u4e0b\u7684\u8a2d\u5099\uff1a<\/p>\n\n\n\n<ol><li><a href=\"https:\/\/www.icshop.com.tw\/product-page.php?28659\" target=\"_blank\" rel=\"noreferrer noopener\">Pixel:Bit<\/a> x1<\/li><li>Micro USB to USB Type-A \u6578\u64da\u50b3\u8f38\u7dda x1<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e8c\u3001\u786c\u9ad4\u67b6\u69cb<\/h2>\n\n\n\n<p>\u672c\u6b21\u61c9\u7528\u7684\u8edf\u786c\u9ad4\u67b6\u69cb\u5716\u5982\u4e0b\u5716\u6240\u793a\uff0c\u786c\u9ad4\u65b9\u9762 ESP32 \u7d50\u5408 Camera \u53ca TFT\uff0c\u8edf\u9ad4\u65b9\u9762\u9700\u8981\u6307\u5b9a Camera \u8f38\u51fa\u5f71\u50cf\u70ba Jpeg\uff0c\u4e26\u4e14\u900f\u904e TJpg_Decoder Library \u89e3\u78bc\u4e26\u4f7f\u7528 DMA\uff08\u76f4\u63a5\u8a18\u61b6\u9ad4\u5b58\u53d6\uff0cDirect Memory Access\uff09SPI \u5beb\u5165 TFT\uff0c\u900f\u904e DMA \u6709\u5169\u500b\u597d\u8655\uff1a\u4e00\u662f\u53ef\u4ee5\u7bc0\u7701 CPU \u6548\u80fd\uff0c\u4e8c\u662f\u56e0\u70ba\u6e1b\u5c11\u4e86\u900f\u904e CPU \u8abf\u7528\uff0c\u6240\u4ee5\u53ef\u4ee5\u63d0\u9ad8\u904b\u884c\u901f\u5ea6\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/l7s9Hk7ecNeOQTLzWIfcAaZcgV-b5vcH7c8ld7F7JVvgns1gfMbiTPKmlx_geM6nKfu8JEG8liVC0-wc2tSNAcRt827ANPf2-8_CBV_w95v7BqKxt1iTk70E2JSVRAXMSTArYTrp6XARne4JDg\" alt=\"\" width=\"554\" height=\"536\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u4e09\u3001\u64cd\u4f5c\u8aaa\u660e<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. \u76ee\u6a19<\/h3>\n\n\n\n<p>\u672c\u6b21\u61c9\u7528\u8981\u5b8c\u6210\u7684\u76ee\u6a19\u662f\u5c07\u8b80\u53d6\u5230\u7684\u5f71\u50cf\u4e32\u6d41\u5230 TFT \u87a2\u5e55\u4e0a\uff0c\u4e26\u4e14\u9054\u5230\u5e7e\u4e4e\u4e0d\u5ef6\u9072\u7684\u6548\u679c\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. \u5b89\u88dd Library<\/h3>\n\n\n\n<p>\u5728\u958b\u59cb\u4e4b\u524d\u6211\u5011\u9700\u8981\u5148\u5b89\u88dd\u4ee5\u4e0b\u5e7e\u500b Library\uff1a<\/p>\n\n\n\n<ul><li>TJpg_Decoder\uff08\u53ef\u5f9e Arduino IDE Library Manager \u5b89\u88dd\uff09<\/li><li><a href=\"https:\/\/github.com\/lorol\/LITTLEFS\" target=\"_blank\" rel=\"noreferrer noopener\">LITTLEFS<\/a>\uff08\u5f9e Github \u4e0b\u8f09\u5f8c\u653e\u5165 Arduino\/Library \u8cc7\u6599\u593e\u5167\uff09<\/li><\/ul>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/niKQp6QmnLYYeVKcCD1pKw7NgE-q-jILYa3UegtPW2ePkHtOi1_KkilsXUig6pUGq9jn6d-JhozWE8_PyKDs3csgTG0FjS5OH1CxVilLTAjVmaMnITswfMUdw9w40WE3jAeJsBKTMmIPScyqEg\" alt=\"\" width=\"591\" height=\"333\"\/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">3. \u7bc4\u4f8b\u7a0b\u5f0f<\/h3>\n\n\n\n<p>\u958b\u555f\u6b64\u6b21\u7bc4\u4f8b\u7a0b\u5f0f 01_CameraTFT\/PixelBit_CameraTFT_ESP32\uff0c\u71d2\u9304\u81f3 <a href=\"https:\/\/www.icshop.com.tw\/product-page.php?28659\" target=\"_blank\" rel=\"noreferrer noopener\">Pixel:Bit<\/a>\uff0c\u6210\u529f\u5f8c\u5373\u53ef\u770b\u5230\u5f71\u50cf\u756b\u9762\u5373\u6642\u4e32\u6d41\u5230TFT\u87a2\u5e55\u4e0a\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.circuspi.com\/wp-content\/uploads\/2022\/05\/2.gif\" alt=\"\" class=\"wp-image-15316\" width=\"493\" height=\"389\"\/><\/figure><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">4. \u7a0b\u5f0f\u8aaa\u660e<\/h3>\n\n\n\n<p>\u5728\u521d\u59cb\u5316\u6642\u6211\u5011\u9700\u8981\u5c07 Camera \u8f38\u51fa\u683c\u5f0f\u6307\u5b9a\u70ba JPEG\uff0c\u4e26\u4e14\u56e0 TFT \u89e3\u6790\u5ea6\u70ba 240&#215;240\uff0c\u6240\u4ee5\u6211\u5011\u5c07 Camera \u8f38\u51fa\u7684\u89e3\u6790\u5ea6\u8a2d\u70ba\u540c\u6a23 240&#215;240\uff0c\u9019\u6a23\u53ef\u4ee5\u7701\u53bb\u526a\u88c1\u5716\u7247\u7684\u6b65\u9a5f\uff0cjpeg_quality \u6578\u503c\u6703\u5f71\u97ff\u5230\u5716\u50cf\u8f38\u51fa\u54c1\u8cea\uff0c\u6578\u503c\u8d8a\u4f4e\u54c1\u8cea\u8d8a\u9ad8\uff1bfb_count \u5247\u6703\u6c7a\u5b9a frame buffers \u7684\u6578\u91cf\uff0c\u5efa\u8b70\u4f7f\u7528\u8005\u53ef\u4ee5\u4f9d\u7167\u6211\u5011\u63d0\u4f9b\u7684\u7bc4\u4f8b\u7a0b\u5f0f\u8a2d\u5b9a\u53c3\u6578\u8a2d\u5b9a\u5373\u53ef\uff0c\u5982\u4e0b\u5716\u6240\u793a\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/iYBofhJIZnGR5O7XS7XLt2zccJIK6UGCFjEgQb8FZjBNxUr76RfNi-658K9Bb5WTv4Quwh8Tv1xuZyx_y6-2zheEdWszpOexMKH1IJ8lGQoYxYgr8DMNF3NeSpjob-Tjh2PwlcXOs0sBLfxlMw\" alt=\"\" width=\"315\" height=\"78\"\/><\/figure><\/div>\n\n\n\n<p>\u63a5\u8457\u6211\u5011\u9700\u8981\u8a2d\u5b9a\u89e3\u78bc\u5f8c\u7684\u5716\u50cf\u7e2e\u5c0f\u500d\u6578\uff0c\u9019\u88e1\u56e0\u70ba\u6211\u5011\u7684 TFT \u53ca Camera \u8f38\u51fa\u89e3\u6790\u5ea6\u76f8\u540c\uff0c\u6240\u4ee5\u8a2d\u5b9a\u7e2e\u5c0f\u500d\u6578\u70ba 1\uff08\u4e0d\u7e2e\u5c0f\uff09\uff0c\u4e4b\u5f8c\u4f7f\u7528 TFT_eSPI setSwapBytes \u65b9\u6cd5\u6307\u5b9a\u5716\u50cf\u6e32\u67d3\u524d\u9700\u8981\u5c07 RGB \u8f49\u6210 BGR\uff0c\u9019\u6a23\u624d\u80fd\u6b63\u78ba\u986f\u793a\u984f\u8272\uff0c\u6700\u5f8c\u8a2d\u5b9a Jpeg \u89e3\u78bc\u5b8c\u5f8c\u8981\u6e32\u67d3\u5230 TFT \u7684 Callback\uff0c\u5982\u4e0b\u5716\u6240\u793a\uff1a<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/c_R8XY_LUDgMoBr86oHE8cu8yLn6ap3QY1XV12xE8PzLaDngBbD2YerP7HtvnE7rtgeGM9YOo4e77-4_2Eo-C6qf0Yrwzl4A5YchfkJDRn8ZgUlVoH0tekHzUAEUtjodyXoYFbNr78i25aENew\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<p>\u5728 Loop \u51fd\u5f0f\u88e1\u9996\u5148\u4f9d\u7167\u4ee5\u5f80\u4f7f\u7528 esp_camera_fb_get \u7684\u65b9\u6cd5\u53d6\u5f97\u4e00\u5f35\u7167\u7247\uff0c\u4e26\u4e14\u6aa2\u67e5\u56de\u50b3\u503c\u662f\u5426\u6709\u6548\u8207\u5716\u7247\u683c\u5f0f\u662f\u5426\u70ba JPEG\uff0c\u63a5\u8457\u4f7f\u7528 startWrite \u65b9\u6cd5\u5c07 TFT SPI CS Line \u62c9\u4f4e\u4ee5\u6e96\u5099\u5c07\u8cc7\u6599\u9001\u5165 TFT\uff0c\u4f7f\u7528 TJpg_Decoder drawJpg \u7684\u65b9\u6cd5\u5c07 JPEG \u5f71\u50cf\u8cc7\u6599\u9001\u5165\u89e3\u78bc\uff0c\u4e00\u65e6\u89e3\u78bc\u5b8c\u7562\u5f8c\u5c07\u70ba\u81ea\u52d5\u547c\u53eb Callback tft_output \u51fd\u5f0f\u900f\u904e DMA SPI \u5c07\u5f71\u50cf\u6e32\u67d3\u5230 TFT \u4e0a\uff0c\u6700\u5f8c\u4f7f\u7528 endWrite \u7684\u65b9\u6cd5\u91cb\u653e TFT SPI CS Line \u8b93\u7d66\u5176\u4ed6 SPI \u4ecb\u9762\u4f7f\u7528\u3002<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/L45MgxY1zr5s_EpmKQMgnBJkUe22Wzxksarzlhyaw6SrmHsQ_GtfBxG6aVCfF4E1Zm_K7PAXPYAQPE0O0t8iWrN2dQNlyRlwVty-3-Wg-lHpFq8xvzXYXmHBC7b2294qvdPANzs6ImrYqKkT0w\" alt=\"\"\/><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u56db\u3001\u5c0f\u7d50<\/h2>\n\n\n\n<p>\u53ea\u8981\u900f\u904e\u4e86\u89e3\u5982\u4f55\u6e32\u67d3 JPEG \u5230 TFT \u4e0a\u5f8c\u5c31\u53ef\u4ee5\u884d\u4f38\u66f4\u591a\u6709\u8da3\u61c9\u7528\uff0c\u4f8b\u5982\u53ef\u4ee5\u4f7f\u7528\u5169\u500b <a href=\"https:\/\/www.icshop.com.tw\/product-page.php?28659\" target=\"_blank\" rel=\"noreferrer noopener\">Pixel:Bit<\/a> \u900f\u904e Wi-Fi \u5be6\u73fe\u7c21\u6613\u8996\u8a0a\u529f\u80fd\uff0c\u6216\u8005\u662f\u5c07\u7db2\u8def\u4e0a\u5404\u7a2e JPEG \u5716\u6a94\u4e32\u6d41\u5230 TFT \u8b8a\u6210\u7c21\u6613\u7684\u5e7b\u71c8\u7247\u61c9\u7528\uff0c\u4ee5\u4e0a\u5c31\u662f\u9019\u6b21\u6559\u5b78\u5206\u4eab\uff0c\u4e0b\u500b\u55ae\u5143\u6211\u5011\u8981\u4ecb\u7d39\u300cEdge Impulse \u5f71\u50cf\u8fa8\u8b58\u5be6\u4f5c\u300d\uff0c\u6709\u8208\u8da3\u7684\u5925\u4f34\u5011\u8acb\u7e7c\u7e8c\u95dc\u6ce8\u6211\u5011\u5594\uff01\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pixel:Bit \u6559\u5b78(\u56db) \u8981\u6559\u5927\u5bb6\u5982\u4f55\u4f7f\u7528500 \u842c\u50cf\u7d20\u7684 OV5640 Camera \u6a21\u7d44\uff0c\u5c07\u8b80\u53d6\u5230\u7684\u5f71\u50cf\u4e32\u6d41\u5230 TFT  1.3 \u540b\u5f69\u8272 LCD \u87a2\u5e55\u4e0a\uff0c\u4e26\u4e14\u9054\u5230\u5e7e\u4e4e\u4e0d\u5ef6\u9072\u7684\u6548\u679c\uff0c\u6211\u5011\u63d0\u4f9b\u8a73\u7d30\u7684\u7bc4\u4f8b\u7a0b\u5f0f\uff0c\u8b93\u4f7f\u7528\u8005\u8f15\u9b06\u5b78\u7fd2\u8207\u4f7f\u7528\u3002<\/p>\n","protected":false},"author":1,"featured_media":15783,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[274,238],"tags":[36,275,109],"table_tags":[],"_links":{"self":[{"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/15301"}],"collection":[{"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/comments?post=15301"}],"version-history":[{"count":9,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/15301\/revisions"}],"predecessor-version":[{"id":15817,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/posts\/15301\/revisions\/15817"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/media\/15783"}],"wp:attachment":[{"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/media?parent=15301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/categories?post=15301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/tags?post=15301"},{"taxonomy":"table_tags","embeddable":true,"href":"https:\/\/www.circuspi.com\/index.php\/wp-json\/wp\/v2\/table_tags?post=15301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}