{"id":725,"date":"2022-12-16T13:21:04","date_gmt":"2022-12-16T05:21:04","guid":{"rendered":"http:\/\/wordpress.loc\/?p=725"},"modified":"2023-06-15T12:58:26","modified_gmt":"2023-06-15T04:58:26","slug":"esp32_ch2-17","status":"publish","type":"post","link":"https:\/\/www.nmking.io\/index.php\/2022\/12\/16\/725\/","title":{"rendered":"ESP32CAM TFTLCD\u986f\u793a"},"content":{"rendered":"\n<figure class=\"wp-block-pullquote\"><blockquote><p>\u4e4b\u524d\u6709\u6559\u904e\u62cd\u7167\u7136\u5f8c\u9001\u5230Azure\u505a\u81c9\u90e8\u8fa8\u8b58\uff0c\u4f46\u662f\u767c\u73fe\u5b78\u751f\u7e3d\u662f\u628a\u7167\u7247\u62cd\u4e86\u4e0a\u4e0b\u985b\u5012\uff0c\u6216\u8005\u6b6a\u6b6a\u626d\u626d\uff0c\u5c0e\u81f4\u8fa8\u8b58\u4e0d\u51fa\u4f86\uff0c\u62b1\u6028\u8aaa\uff0c\u6c92\u8fa6\u6cd5\u5148\u9810\u89bd\u5c0d\u6e96\uff0c\u6240\u4ee5\u4e0d\u77e5\u9053\u62cd\u5230\u4ec0\u9ebc\u3002<\/p><\/blockquote><\/figure>\n\n\n\n<p>2023\/02\u66f4\u65b0\uff0c\u5c0f\u9738\u738bEZCAM\u64f4\u5145\u6a21\u7d44\u5df2\u7d93\u4e0a\u5e02\u4e86\uff0c\u53ef\u4ee5\u76f4\u63a5\u514d\u63a5\u7dda\u4f7f\u7528TFT\u87a2\u5e55\uff0c\u4e26\u63d0\u4f9b\u7bc4\u4f8b\u7a0b\u5f0f\uff0c\u8acb\u53c3\u8003\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/www.nmking.io\/index.php\/2023\/03\/12\/982\/\" target=\"_blank\">https:\/\/www.nmking.io\/index.php\/2023\/03\/12\/982\/<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"764\" src=\"https:\/\/i0.wp.com\/www.nmking.io\/wp-content\/uploads\/2023\/06\/image-30.png?resize=1024%2C764&#038;ssl=1\" alt=\"\" class=\"wp-image-1294\" srcset=\"https:\/\/i0.wp.com\/www.nmking.io\/wp-content\/uploads\/2023\/06\/image-30.png?resize=1024%2C764&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.nmking.io\/wp-content\/uploads\/2023\/06\/image-30.png?resize=300%2C224&amp;ssl=1 300w, https:\/\/i0.wp.com\/www.nmking.io\/wp-content\/uploads\/2023\/06\/image-30.png?resize=768%2C573&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.nmking.io\/wp-content\/uploads\/2023\/06\/image-30.png?resize=200%2C149&amp;ssl=1 200w, https:\/\/i0.wp.com\/www.nmking.io\/wp-content\/uploads\/2023\/06\/image-30.png?w=1191&amp;ssl=1 1191w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<div class=\"wp-block-ht-block-toc is-style-rounded htoc htoc--position-wide toc-list-style-plain\" data-htoc-state=\"expanded\"><span class=\"htoc__title\"><span class=\"ht_toc_title\">Table of Contents<\/span><span class=\"htoc__toggle\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"16\" height=\"16\"><g fill=\"#444\"><path d=\"M15 7H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1z\"><\/path><path d=\"M15 1H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1zM15 13H1c-.6 0-1 .4-1 1s.4 1 1 1h14c.6 0 1-.4 1-1s-.4-1-1-1z\"><\/path><\/g><\/svg><\/span><\/span><div class=\"htoc__itemswrap\"><ul class=\"ht_toc_list\"><li class=\"\"><a href=\"#htoc-\">\u5be6\u505a\u8aaa\u660e<\/a><\/li><li class=\"\"><a href=\"#htoc-1\">\u4e00\u3001\u6750\u6599\u6e96\u5099<\/a><\/li><li class=\"\"><a href=\"#htoc-11\">\u4e8c\u3001\u63a5\u7dda<\/a><\/li><li class=\"\"><a href=\"#htoc-111\">\u4e09\u3001\u5b89\u88dd\u7a0b\u5f0f\u5eab<\/a><\/li><li class=\"\"><a href=\"#htoc-1111\">\u56db\u3001\u71d2\u9304\u7a0b\u5f0f\u78bc<\/a><\/li><\/ul><\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-\">\u5be6\u505a\u8aaa\u660e<\/h2>\n\n\n\n<p>\u4ee5\u5f80\u4f7f\u7528ESP32CAM\u90fd\u8981\u900f\u904e\u7db2\u8def\u50b3\u8f38\u5f71\u50cf\uff0c\u4e0d\u7136\u5c31\u662f\u62cd\u7167\u653e\u5728SD\u5361\uff0c\u4e4b\u524d\u6709\u6559\u904e\u62cd\u7167\u7136\u5f8c\u9001\u5230Azure\u505a\u81c9\u90e8\u8fa8\u8b58\uff0c\u4f46\u662f\u767c\u73fe\u5b78\u751f\u7e3d\u662f\u628a\u7167\u7247\u62cd\u4e86\u4e0a\u4e0b\u985b\u5012\uff0c\u6216\u8005\u6b6a\u6b6a\u626d\u626d\uff0c\u5c0e\u81f4\u8fa8\u8b58\u4e0d\u51fa\u4f86\uff0c\u62b1\u6028\u8aaa\uff0c\u6c92\u8fa6\u6cd5\u5148\u9810\u89bd\u5c0d\u6e96\uff0c\u6240\u4ee5\u4e0d\u77e5\u9053\u62cd\u5230\u4ec0\u9ebc\u3002<\/p>\n\n\n\n<p>\u7db2\u8def\u627e\u4e86\u4e00\u4e9b\u7bc4\u4f8b\uff0c\u4e3b\u8981\u6709\u5169\u7a2e\uff0c\u4e00\u7a2e\u662fI2C\u7684OLED\uff0c\u4e0d\u904e\u756b\u8cea\u5f88\u5dee\uff0c\u4e3b\u8981OLED\u53ea\u6709\u5169\u8272\uff0c\u6240\u4ee5\u986f\u793a\u6548\u679c\u985e\u4f3c\u9ed1\u767d\u7167\u7247\uff0c\u4f8b\u5982\uff1a<a href=\"https:\/\/blog.csdn.net\/qq_28877125\/article\/details\/99687985\">ESP32-CAM\u83b7\u53d6\u7684\u56fe<\/a><a href=\"https:\/\/blog.csdn.net\/qq_28877125\/article\/details\/99687985\" target=\"_blank\" rel=\"noreferrer noopener\">\u50cf\u663e\u793a\u5728OLED\u4e0a\u9762<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1607857756-2755661618-g_n.png?resize=840%2C606&#038;ssl=1\" alt=\"\" width=\"840\" height=\"606\"\/><figcaption class=\"wp-element-caption\">\u986f\u793a\u65bcOLED\u6548\u679c<\/figcaption><\/figure>\n\n\n\n<p>\u53e6\u5916\u4e00\u7a2e\u5c31\u662fSPI TFT\uff0c\u756b\u9762\u8f03\u70ba\u6d41\u66a2\uff0c\u9084\u53ef\u4ee5\u89f8\u63a7\uff08\u672c\u6587\u6c92\u6709\u7528\u5230\uff09\uff0c\u756b\u9762\u5c31\u6f02\u4eae\u591a\u4e86\uff0c\u672c\u6587\u4e3b\u8981\u53c3\u8003\u9019\u7bc7\uff1a<a href=\"ESP32-CAM: \u9023\u63a5ILI9341\u6db2\u6676\u87a2\u5e55\">E<\/a><a href=\"https:\/\/blog.xuite.net\/iamleon\/blog\/589421027\">SP3<\/a><a href=\"ESP32-CAM: \u9023\u63a5ILI9341\u6db2\u6676\u87a2\u5e55\">2-CAM: \u9023\u63a5ILI9341\u6db2\u6676\u87a2\u5e55<\/a>\uff0c\u7136\u5f8c\u505a\u4e86\u5c0f\u5c0f\u4fee\u6539<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1607863577-1681485300-g_n.jpg?resize=841%2C631&#038;ssl=1\" alt=\"\" width=\"841\" height=\"631\"\/><figcaption class=\"wp-element-caption\">\u986f\u793a\u65bcSPI TFT\u6548\u679c<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-1\">\u4e00\u3001\u6750\u6599\u6e96\u5099<\/h2>\n\n\n\n<p>ESP32CAM+USBTTL\uff08\u6216ESP32CAM CH340\uff09<br>SPI TFT\uff0c\u578b\u865f\uff1aTJCTM24028-SPI<br>\u675c\u90a6\u7dda\u82e5\u5e72<br>\u74b0\u5883\u8a2d\u5b9a\u8acb\u53c3\u8003\u9019\u7bc7\uff1a<a href=\"https:\/\/www.nmking.io\/index.php\/2022\/11\/03\/esp32_ch2\/\">ESP32-CAM (arduino)\u5f71\u50cf\u4f3a\u670d\u5668\u53ca\u81c9\u90e8\u8fa8\u8b58\u6559\u5b78\u539f\u59cb\u6a94Video Stream Server<\/a>\uff0c\u4e5f\u8acb\u5148\u4f7f\u7528\u7bc4\u4f8b\u7a0b\u5f0f\u9032\u884c\u6e2c\u8a66\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-11\">\u4e8c\u3001\u63a5\u7dda<\/h2>\n\n\n\n<p>\u8acb\u4f9d\u7167\u4e0b\u8868\u5b8c\u6210\u63a5\u7dda<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-center\" data-align=\"center\">TFT<\/th><th class=\"has-text-align-center\" data-align=\"center\">ESP32CAM<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">SDO(MISO)<\/td><td class=\"has-text-align-center\" data-align=\"center\">12<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">LED<\/td><td class=\"has-text-align-center\" data-align=\"center\">3.3V (VCC)<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">SCK<\/td><td class=\"has-text-align-center\" data-align=\"center\">14<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">SDI(MOSI)<\/td><td class=\"has-text-align-center\" data-align=\"center\">13<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">D\/C<\/td><td class=\"has-text-align-center\" data-align=\"center\">2<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">RESET<\/td><td class=\"has-text-align-center\" data-align=\"center\">16<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">CS<\/td><td class=\"has-text-align-center\" data-align=\"center\">15<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">GND<\/td><td class=\"has-text-align-center\" data-align=\"center\">GND<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">VCC<\/td><td class=\"has-text-align-center\" data-align=\"center\">3.3V (VCC)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1608142216-2184958957-g.png?resize=842%2C612&#038;ssl=1\" alt=\"\" width=\"842\" height=\"612\"\/><\/figure>\n\n\n\n<p class=\"quote\">\u539f\u672c\u7684\u6587\u7ae0RESET\u662f\u63a5\u57284\uff0c\u5c0e\u81f4\u9583\u5149\u4eae\u5230\u773c\u775b\u775c\u4e0d\u958b\uff0c\u6240\u4ee5\u9019\u88e1\u6539\u752816<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-111\">\u4e09\u3001\u5b89\u88dd\u7a0b\u5f0f\u5eab<\/h2>\n\n\n\n<p>\u4e00\u5171\u6709\u5169\u500b\u7a0b\u5f0f\u5eab\u8981\u5b89\u88dd<\/p>\n\n\n\n<p>TFT\u7a0b\u5f0f\u5eab\uff1a\u95dc\u9375\u5b57\u8f38\u5165&#8221;TFT_eSPI&#8221;\uff0c\u7136\u5f8c\u627e\u5230\u4f5c\u8005\u662f&#8221;Bodmer&#8221;\u7684\u9019\u500b\uff0c\u9ede\u5b89\u88dd\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1607862886-3170329659-g_n.png?resize=840%2C475&#038;ssl=1\" alt=\"\" width=\"840\" height=\"475\"\/><figcaption class=\"wp-element-caption\">\u5b89\u88ddTFT_eSPI\u7a0b\u5f0f\u5eab<\/figcaption><\/figure>\n\n\n\n<p>TJpg_Decoder\u89e3\u78bc\u5668\uff1a\u95dc\u9375\u5b57\u8f38\u5165&#8221;TJpg_Decoder&#8221;\uff0c\u7136\u5f8c\u627e\u5230\u4f5c\u8005\u662f&#8221;Bodmer&#8221;\u7684\u9019\u500b\uff0c\u9ede\u5b89\u88dd\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1607862816-3889599704-g_n.png?resize=841%2C475&#038;ssl=1\" alt=\"\" width=\"841\" height=\"475\"\/><figcaption class=\"wp-element-caption\">\u5b89\u88ddTJpg_Decoder\u89e3\u78bc\u5668\u7a0b\u5f0f\u5eab<\/figcaption><\/figure>\n\n\n\n<p>\u5b89\u88dd\u5b8c\u7562\u4e4b\u5f8c\uff0c\u9700\u8981\u4fee\u6539\u4e00\u4e0b\u7a0b\u5f0f\u5eab\u5167\u7684User_Setup.h\uff0c\u4e3b\u8981\u662f\u56e0\u70ba\u7a0b\u5f0f\u5eab\u5167\u8a2d\u8a08\u662f\u7d66ESP32\u800c\u4e0d\u662fESP32CAM\u7528\u7684\uff0c\u6240\u4ee5\u8981\u88dc\u4e0a\u4e00\u4e9b\u8173\u4f4d\u5b9a\u7fa9<\/p>\n\n\n\n<p class=\"quote\">\u907f\u514d\u9ebb\u7169\u5927\u5bb6\u88dc\u932f\uff0c\u53ef\u4ee5\u76f4\u63a5\u4e0b\u8f09\u9019\u500b\u6a94\u6848\uff1a<a rel=\"noreferrer noopener\" href=\"https:\/\/bit.ly\/3oRCcyj\" target=\"_blank\">https:\/\/bit.ly\/3oRCcyj<\/a><\/p>\n\n\n\n<p>\u4e26\u8986\u84cb\u6389\u7a0b\u5f0f\u5eab\u5167\u7684User_Setup.h\uff0cUser_Setup.h\u4e00\u822c\u662f\u5728\u300cC:\\Users\\\u4f60\u7684\u5e33\u865f\\Documents\\Arduino\\libraries\\TFT_eSPI\u300d<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"htoc-1111\">\u56db\u3001\u71d2\u9304\u7a0b\u5f0f\u78bc<\/h2>\n\n\n\n<p>\u7a0b\u5f0f\u78bc\u539f\u59cb\u6a94\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include \"esp_camera.h\"\n#include \"SPI.h\"\n#include &lt;TFT_eSPI.h&gt;              \/\/ Hardware-specific library\n#include &lt;TJpg_Decoder.h&gt;\n\n#define PWDN_GPIO_NUM     32\n#define RESET_GPIO_NUM    -1\n#define XCLK_GPIO_NUM      0\n#define SIOD_GPIO_NUM     26\n#define SIOC_GPIO_NUM     27\n#define Y9_GPIO_NUM       35\n#define Y8_GPIO_NUM       34\n#define Y7_GPIO_NUM       39\n#define Y6_GPIO_NUM       36\n#define Y5_GPIO_NUM       21\n#define Y4_GPIO_NUM       19\n#define Y3_GPIO_NUM       18\n#define Y2_GPIO_NUM        5\n#define VSYNC_GPIO_NUM    25\n#define HREF_GPIO_NUM     23\n#define PCLK_GPIO_NUM     22\n\nuint16_t  dmaBuffer1&#91;16 * 16]; \/\/ Toggle buffer for 16*16 MCU block, 512bytes\nuint16_t  dmaBuffer2&#91;16 * 16]; \/\/ Toggle buffer for 16*16 MCU block, 512bytes\nuint16_t* dmaBufferPtr = dmaBuffer1;\nbool dmaBufferSel = 0;\n\nTFT_eSPI tft = TFT_eSPI();         \/\/ Invoke custom library\n\n\/\/ This next function will be called during decoding of the jpeg file to render each\n\/\/ 16x16 or 8x8 image tile (Minimum Coding Unit) to the TFT.\nbool tft_output(int16_t x, int16_t y, uint16_t w, uint16_t h, uint16_t* bitmap)\n{\n  \/\/ Stop further decoding as image is running off bottom of screen\n  if ( y &gt;= tft.height() ) return 0;\n  if (dmaBufferSel) dmaBufferPtr = dmaBuffer2;\n  else dmaBufferPtr = dmaBuffer1;\n  dmaBufferSel = !dmaBufferSel; \/\/ Toggle buffer selection\n  \/\/  pushImageDMA() will clip the image block at screen boundaries before initiating DMA\n  tft.pushImageDMA(x, y, w, h, bitmap, dmaBufferPtr); \/\/ Initiate DMA - blocking only if last DMA is not complete\n  \/\/ The DMA transfer of image block to the TFT is now in progress...\n\n  \/\/ Return 1 to decode next block.\n  return 1;\n}\n\n\nvoid setup() {\n  Serial.begin(115200);\n  Serial.setDebugOutput(true);\n  Serial.println();\n  camera_config_t config;\n  config.ledc_channel = LEDC_CHANNEL_0;\n  config.ledc_timer = LEDC_TIMER_0;\n  config.pin_d0 = Y2_GPIO_NUM;\n  config.pin_d1 = Y3_GPIO_NUM;\n  config.pin_d2 = Y4_GPIO_NUM;\n  config.pin_d3 = Y5_GPIO_NUM;\n  config.pin_d4 = Y6_GPIO_NUM;\n  config.pin_d5 = Y7_GPIO_NUM;\n  config.pin_d6 = Y8_GPIO_NUM;\n  config.pin_d7 = Y9_GPIO_NUM;\n  config.pin_xclk = XCLK_GPIO_NUM;\n  config.pin_pclk = PCLK_GPIO_NUM;\n  config.pin_vsync = VSYNC_GPIO_NUM;\n  config.pin_href = HREF_GPIO_NUM;\n  config.pin_sscb_sda = SIOD_GPIO_NUM;\n  config.pin_sscb_scl = SIOC_GPIO_NUM;\n  config.pin_pwdn = PWDN_GPIO_NUM;\n  config.pin_reset = RESET_GPIO_NUM;\n  config.xclk_freq_hz = 10000000;\n  config.pixel_format = PIXFORMAT_JPEG;\n  config.frame_size = FRAMESIZE_QVGA; \/\/FRAMESIZE_QVGA 320x240\n  config.jpeg_quality = 10; \/\/&lt; Quality of JPEG output. 0-63 lower means higher quality\n  config.fb_count = 2; \/\/Number of frame buffers to be allocated. If more than one, then each frame will be acquired (double speed)\n\n  \/\/ camera init\n  esp_err_t err = esp_camera_init(&amp;config);\n  if (err != ESP_OK) {\n    Serial.printf(\"Camera init failed with error 0x%x\", err);\n    return;\n  }\n  \n  sensor_t * s = esp_camera_sensor_get();\n  s-&gt;set_contrast(s, 2);       \/\/ -2 to 2\n  s-&gt;set_saturation(s, 1);     \/\/ -2 to 2\n\n  \/\/ Initialise the TFT\n  tft.begin();\n  tft.setTextColor(TFT_WHITE, TFT_BLACK);\n  tft.fillScreen(TFT_BLACK);\n  tft.setTextColor(TFT_ORANGE, TFT_BLACK);\n  tft.setRotation(3);\/\/1:landscape 3:inv. landscape\n\n\n  tft.initDMA(); \/\/ To use SPI DMA you must call initDMA() to setup the DMA engine\n  \/\/ The jpeg image can be scaled down by a factor of 1, 2, 4, or 8\n  TJpgDec.setJpgScale(1);\n  \/\/ The colour byte order can be swapped by the decoder\n  \/\/ using TJpgDec.setSwapBytes(true); or by the TFT_eSPI library:\n  tft.setSwapBytes(true);\n  \/\/ The decoder must be given the exact name of the rendering function above\n  TJpgDec.setCallback(tft_output);\n}\n\nvoid loop() {\n  camera_fb_t *fb = NULL;\n  esp_err_t res = ESP_OK;\n  fb = esp_camera_fb_get();\n  if (!fb) {\n    Serial.println(\"Camera capture failed\");\n    esp_camera_fb_return(fb);\n    return;\n  }\n\n  size_t fb_len = 0;\n  if (fb-&gt;format != PIXFORMAT_JPEG) {\n    Serial.println(\"Non-JPEG data not implemented\");\n    return;\n  }\n  \/\/ Must use startWrite first so TFT chip select stays low during DMA and SPI channel settings remain configured\n  tft.startWrite();\n  \/\/ Draw the image, top left at 0,0 - DMA request is handled in the call-back tft_output() in this sketch\n  \/\/TJpgDec.drawJpg(0, 0, panda, sizeof(panda));\n  TJpgDec.drawJpg(0, 0,  fb-&gt;buf, fb-&gt;len);\n  \/\/ Must use endWrite to release the TFT chip select and release the SPI channel\n  tft.endWrite();\n  esp_camera_fb_return(fb);\n}<\/code><\/pre>\n\n\n\n<p>\u5982\u679c\u756b\u9762\u4e00\u7247\u7a7a\u767d\uff0cRST\u5e7e\u6b21\u5c31\u6b63\u5e38\u4e86<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/pic.pimg.tw\/youyouyou\/1607863577-1681485300-g_n.jpg?resize=841%2C631&#038;ssl=1\" alt=\"\" width=\"841\" height=\"631\"\/><figcaption class=\"wp-element-caption\">\u539f\u5ee0\u93e1\u982d\u6548\u679c<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u4e4b\u524d\u6709\u6559\u904e\u62cd\u7167\u7136\u5f8c\u9001\u5230Azure\u505a\u81c9\u90e8\u8fa8\u8b58\uff0c\u4f46\u662f\u767c\u73fe\u5b78\u751f\u7e3d\u662f\u628a\u7167\u7247\u62cd\u4e86\u4e0a\u4e0b\u985b\u5012\uff0c\u6216\u8005\u6b6a\u6b6a\u626d\u626d\uff0c\u5c0e\u81f4\u8fa8\u8b58\u4e0d\u51fa\u4f86\uff0c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1,26],"tags":[],"class_list":["post-725","post","type-post","status-publish","format-standard","hentry","category-esp32","category-esp32cam"],"blocksy_meta":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts\/725","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/comments?post=725"}],"version-history":[{"count":3,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts\/725\/revisions"}],"predecessor-version":[{"id":1297,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/posts\/725\/revisions\/1297"}],"wp:attachment":[{"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/media?parent=725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/categories?post=725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.nmking.io\/index.php\/wp-json\/wp\/v2\/tags?post=725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}