发 帖  
[问答]

OV7670+24L01如何实现TFT屏显示?

1219 OV7670







这是我接收代码


[C] 纯文本查看 复制代码
#include "sys.h"#include "usart.h"#include "delay.h"#include "led.h" #include "beep.h"  #include "key.h"  #include "exti.h"  #include "wdg.h"  #include "timer.h"  #include "tpad.h"#include "oled.h"  #include "lcd.h"#include "usmart.h"#include "rtc.h"  #include "wkup.h"#include "adc.h"  #include "dac.h"  #include "dma.h"  #include "24cxx.h"  #include "flash.h"  #include "rs485.h"  #include "can.h"  #include "touch.h"  #include "remote.h"  #include "joypad.h"#include "adxl345.h"#include "ds18b20.h"#include "dht11.h"#include "24l01.h"#include "mouse.h"#include "stmflash.h"#include "rda5820.h"#include "audiosel.h"#include "ov7670.h"#include "sram.h"#include "malloc.h"#include "string.h" int main(void){u32 count=0;u32 receivecount=0;//记录接收到的数据,当其大于320*240*2时重置为0u32 ReceiveCount=0;u8* showbuf;u8* a;   u16 color; Stm32_Clock_Init(9);//系统时钟设置uart_init(72,9600); //串口初始化为9600delay_init(72);    //延时初始化 LCD_Init();   //初始化LCDusmart_dev.init(72);//初始化USMARTNRF24L01_Init();//初始化无线模块FSMC_SRAM_Init();//初始化外部SRAMmem_init(SRAMEX);LCD_Clear(WHITE);while(NRF24L01_Check())//检查NRF24L01是否在位.{LCD_ShowString(60,130,200,16,16,"NRF24L01 Error");delay_ms(200);LCD_Fill(60,130,239,130+16,WHITE); delay_ms(200);}   LCD_ShowString(60,130,200,16,16,"NRF24L01 OK");showbuf=(u8*)mymalloc(SRAMEX,240*320*2+5);a=showbuf; //记录初始地址NRF24L01_TX_Mode();//配置为发送模式while(NRF24L01_TxPacket(showbuf)!=0);//发送同步信号通知开始采集图像delay_ms(1000);NRF24L01_RX_Mode();//配置为接收模式LCD_Scan_Dir(U2D_L2R);//从上到下,从左到右 LCD_SetCursor(0x00,0x0000);//设置光标位置 LCD_WriteRAM_Prepare();     //开始写入GRAMNRF24L01_RX_Mode();//配置为接收模式  while(1){while(NRF24L01_RxPacket(showbuf)!=0);//等待数据接收完毕showbuf +=32;receivecount +=32;if(receivecount >=(320*240*2))//接收了一屏数据{showbuf =a;receivecount=0;for(count=0;count<320*240;count++){color=showbuf[receivecount++]&0XFF;//读数据color<<=8;  color|=showbuf[receivecount++]&0XFF;//读数据 LCD->LCD_RAM=color;//向tft屏写入一个点}showbuf =a;NRF24L01_TX_Mode();//配置为发送模式while(NRF24L01_TxPacket(showbuf)!=0);//发送同步信号 通知采集下一帧NRF24L01_RX_Mode();//配置为接收模式LCD_SetCursor(0x00,0x0000);//设置光标位置 LCD_WriteRAM_Prepare();     //开始写入GRAM } }   }


0
2020-5-7 02:10:31   评论 分享淘帖 邀请回答 举报
1个回答
2020-5-7 10:12:48 评论

举报

只有小组成员才能发言,加入小组>>

464个成员聚集在这个小组

加入小组

创建小组步骤

快速回复 返回顶部 返回列表
关注微信公众号

电子发烧友网

电子发烧友论坛

社区合作
刘勇
联系电话:15994832713
邮箱地址:liuyong@huaqiu.com
社区管理
elecfans短短
微信:elecfans_666
邮箱:users@huaqiu.com
关闭

站长推荐 上一条 /6 下一条

快速回复 返回顶部 返回列表