初级会员
- 积分
- 72
- 金钱
- 72
- 注册时间
- 2014-9-10
- 在线时间
- 0 小时
|
楼主 |
发表于 2014-11-8 22:00:14
|
显示全部楼层
回复【7楼】正点原子:
<br>---------------------------------
<br>#include "stm32f10x.h"
<br>#include "usart.h"
<br>#include "sys.h"
<br>#include "delay.h"
<br>#include "lcd.h"
<br>#include "key.h"
<br>#include "led.h"
<br>#include "24l01.h"
<br>#include "spi.h"
<br>
<br>int main(void)
<br>{
<br> u16 wqh_times=4800;
<br> u8 t=0;
<br> u8 tmp_buf[33];
<br>
<br> delay_init(); //???±??????????
<br> NVIC_Configuration(); //?è??NVIC????·?×é2:2??????????????2???ì????????
<br> uart_init(9600); //????????????9600
<br> delay_ms(200);
<br> LCD_Init(); //?????????§
<br> delay_ms(200);
<br> KEY_Init(); //°??ü??????
<br> LED_Init(); //LED??????
<br> NRF24L01_Init(); //??????NRF24L01
<br> POINT_COLOR=RED; //?è??×??????ì??
<br>// LCD_ShowString(60,50,300,16,16," Zhuang Jing o ");
<br>// LCD_ShowString(60,70,300,16,16," NRF24L01 TEST ");
<br>// LCD_ShowString(60,90,300,16,16," Bi She ");
<br> while(NRF24L01_Check())//?ì??????24L01
<br> {
<br> LCD_ShowString(60,130,300,16,16,"24L01 Check Failed!");
<br> delay_ms(500);
<br> LCD_ShowString(60,130,300,16,16,"lease Check! ");
<br> delay_ms(500);
<br> LED0=!LED0;//DS0????
<br> }
<br> LCD_Fill(10,150,240,166,WHITE);//??????????????
<br> POINT_COLOR=BLUE; //?è??×?????????
<br>// {
<br>// LCD_ShowString(60,150,300,16,16,"NRF24L01 RX_Mode");
<br>// LCD_ShowString(60,170,300,16,16,"Received DATA:");
<br> LCD_Fill(10,150,240,166,WHITE);//??????????????
<br> NRF24L01_RX_Mode();
<br> if(lcddev.id==0X6804) //?????è??????·?±?????320*240.???§??3.5???ó??
<br> {
<br> lcddev.width=240;
<br> lcddev.height=320;
<br> }
<br>// OV7670_Window_Set(10,174,240,320); //?è???°??
<br> while(1)
<br> {
<br> if(wqh_times==4800)
<br> {
<br> LCD_Scan_Dir(DFT_SCAN_DIR); //?????????¨?è·??ò
<br> LCD_Scan_Dir(U2D_L2R); //????????,??×ó????
<br> LCD_SetCursor(0x00,0x0000); //?è????±ê????
<br> LCD_WriteRAM_Prepare(); //????????GRAM
<br> wqh_times=0;
<br> }
<br> if(NRF24L01_RxPacket(tmp_buf)==0)//??????????????,?ò????????.
<br> {
<br> tmp_buf[32]=0;//????×?·????á??·?
<br> LCD_ShowString(0,190,300,32,16,tmp_buf);
<br> for(t=0;t<16;t++)
<br> LCD_WR_DATA(tmp_buf[2*t]*256+tmp_buf[2*t+1]);
<br> wqh_times++;
<br> }
<br> else
<br> delay_us(100);
<br> t++;
<br> if(t==10000)//?ó??1s????±?????×???
<br> {
<br> t=0;
<br> LED0=!LED0;
<br> }
<br> }
<br>// }
<br>}
<br>这是接收部分的程序,不知道哪里有问题请指教 |
|