完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
发射端不知道有没有问题,接受端没有收到,原子哥指导下!
#include "STM32f10x.h" #include "usart.h" #include "sys.h" #include "delay.h" #include "lcd.h" #include "exti.h" #include "24l01.h" #include "ov7670.h" #include "spi.h" #include "timer.h" #include "key.h" #include "led.h" extern u8 ov_sta; //??exit.c?????¨?? extern u8 ov_frame; //??timer.c?????¨?? u8 tmp_buf[33]="abcdefghijklABCDEFGHIJKLM1234567";//----???í???????????? u16 mycolor; u8 mycolorH,mycolorL; //?ü??LCD???? void camera_refresh(void) { u32 j; u16 color; u8 t=0,sss=0; if(ov_sta==2) { LCD_Scan_Dir(U2D_L2R); //????????,??×ó???? LCD_SetCursor(0x00,0x0000); //?è????±ê???? LCD_WriteRAM_Prepare(); //????????GRAM OV7670_CS=0; OV7670_RRST=0; //?????????????? OV7670_RCK=0; OV7670_RCK=1; OV7670_RCK=0; OV7670_RRST=1; //???????????á?? OV7670_RCK=1; for(j=0;j<76800;j++) { // GPIOB->CRL=0X88888888; OV7670_RCK=0; color=GPIOC->IDR&0XFF; //?????? OV7670_RCK=1; color<<=8; OV7670_RCK=0; color|=GPIOC->IDR&0XFF; //?????? OV7670_RCK=1; // GPIOB->CRL=0X33333333; LCD->LCD_RAM=color; mycolor=color; mycolorL=mycolor&0x00ff; mycolorH=(mycolor>>8)&0x00ff; for(t=0,sss=0;t<16;t++) { tmp_buf[2*t]=mycolorH; tmp_buf[2*t+1]=mycolorL; sss++,t++; } if(sss==16) { while(NRF24L01_TxPacket(tmp_buf)!=TX_OK); sss=0,t=0; } } OV7670_CS=1; OV7670_RCK=0; OV7670_RCK=1; EXTI_ClearITPendingBit(EXTI_Line8); //????LINE8????????±ê???? ov_sta=0; //?????????????? ov_frame++; LCD_Scan_Dir(DFT_SCAN_DIR); //?????????¨?è·??ò } } int main(void) { u8 i,t; delay_init(); //???±?????????? NVIC_Configuration(); //?è??NVIC????·?×é2:2??????????????2???ì???????? uart_init(9600); //?®??????????9600 LCD_Init(); LED_Init(); OV7670_Init(); NRF24L01_Init(); //??????NRF24L01 while(NRF24L01_Check())//?ì??????24L01 { // LCD_ShowString(60,150,200,16,16,"24L01 Check Failed!"); printf("24L01 Check Failed!"); delay_ms(5000); } NRF24L01_TX_Mode(); // LED0=0; LCD_ShowString(60,150,200,16,16,"24L01 Init OK!"); delay_ms(1500); // printf("24L01 Check OK!"); if(lcddev.id==0X6804) //?????è??????·?±?????320*240.???§??3.5???ó?? { lcddev.width=240; lcddev.height=320; } POINT_COLOR=RED; //?è??×??????ì?? while(OV7670_Init())//??????OV7670 { // LCD_ShowString(60,150,200,200,16,"OV7670 Error!!"); printf("OV7670 Error!!"); // delay_ms(200); // LCD_Fill(60,230,239,246,WHITE); delay_ms(200); } LCD_ShowString(60,150,200,16,16,"OV7670 Init OK"); // printf("OV7670 Init OK"); delay_ms(1500); TIM6_Int_Init(10000,7199); EXTI8_Init(); OV7670_Window_Set(10,174,240,320); //?è???°?? OV7670_CS=0; while(1) { camera_refresh(); //?ü?????? if(i!=ov_frame) //DS0????. { i=ov_frame; LED0=!LED0; } } } 这是主函数和摄像头刷新部分的程序 |
|
相关推荐
11个回答
|
|
其他的都是原子哥的程序,这里是自己搞的,请问这个发送有问题吗?
|
|
|
|
暂时还没用到2.4g 模块,过来学习下。
|
|
|
|
用这个NRF24L01_TxPacket没错。
|
|
|
|
经过检测后发现时有发射,接收端有问题,而且传输的速度非常慢,怎么破
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "stm32f10x.h" #include "usart.h" #include "sys.h" #include "delay.h" #include "lcd.h" #include "key.h" #include "led.h" #include "24l01.h" #include "spi.h" int main(void) { u16 wqh_times=4800; u8 t=0; u8 tmp_buf[33]; delay_init(); //???±?????????? NVIC_Configuration(); //?è??NVIC????·?×é2:2??????????????2???ì???????? uart_init(9600); //????????????9600 delay_ms(200); LCD_Init(); //?????????§ delay_ms(200); KEY_Init(); //°??ü?????? LED_Init(); //LED?????? NRF24L01_Init(); //??????NRF24L01 POINT_COLOR=RED; //?è??×??????ì?? // LCD_ShowString(60,50,300,16,16," Zhuang Jing o "); // LCD_ShowString(60,70,300,16,16," NRF24L01 TEST "); // LCD_ShowString(60,90,300,16,16," Bi She "); while(NRF24L01_Check())//?ì??????24L01 { LCD_ShowString(60,130,300,16,16,"24L01 Check Failed!"); delay_ms(500); LCD_ShowString(60,130,300,16,16,"lease Check! "); delay_ms(500); LED0=!LED0;//DS0???? } LCD_Fill(10,150,240,166,WHITE);//?????????????? POINT_COLOR=BLUE; //?è??×????????? // { // LCD_ShowString(60,150,300,16,16,"NRF24L01 RX_Mode"); // LCD_ShowString(60,170,300,16,16,"Received DATA:"); LCD_Fill(10,150,240,166,WHITE);//?????????????? NRF24L01_RX_Mode(); if(lcddev.id==0X6804) //?????è??????·?±?????320*240.???§??3.5???ó?? { lcddev.width=240; lcddev.height=320; } // OV7670_Window_Set(10,174,240,320); //?è???°?? while(1) { if(wqh_times==4800) { LCD_Scan_Dir(DFT_SCAN_DIR); //?????????¨?è·??ò LCD_Scan_Dir(U2D_L2R); //????????,??×ó???? LCD_SetCursor(0x00,0x0000); //?è????±ê???? LCD_WriteRAM_Prepare(); //????????GRAM wqh_times=0; } if(NRF24L01_RxPacket(tmp_buf)==0)//??????????????,?ò????????. { tmp_buf[32]=0;//????×?·????á??·? LCD_ShowString(0,190,300,32,16,tmp_buf); for(t=0;t<16;t++) LCD_WR_DATA(tmp_buf[2*t]*256+tmp_buf[2*t+1]); wqh_times++; } else delay_us(100); t++; if(t==10000)//?ó??1s????±?????×??? { t=0; LED0=!LED0; } } // } } 这是接收部分的程序,不知道哪里有问题请指教 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
如何使用STM32+nrf24l01架构把有线USB设备无线化?
2574 浏览 7 评论
请问能利用51单片机和nRF24L01模块实现实时语音无线传输吗?
2367 浏览 5 评论
3219 浏览 3 评论
2841 浏览 8 评论
为什么ucosii上移植lwip后系统进入了HardFault_Handler?
2795 浏览 4 评论
请教各位大咖:有没有接收频率32M左右的芯片推荐的?先感谢啦!
674浏览 1评论
912浏览 0评论
1033浏览 0评论
676浏览 0评论
508浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-27 01:12 , Processed in 1.143703 second(s), Total 65, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号