然后接收端最后数据显示在LCD上程序编译不通过,不知道怎么解决了,求助。
#include "stm32f10x.h"
#include "sys.h"
#include "usart.h"
#include "delay.h"
#include "led.h"
#include "key.h"
#include "exti.h"
#include "wdg.h"
#include "timer.h"
#include "lcd.h"
#include "rtc.h"
#include "wkup.h"
#include "adc.h"
#include "dma.h"
#include "24cxx.h"
//#include "flash.h"
#include "touch.h"
#include "24l01.h"
//Mini STM32开发板范例代码19
//无线通信实验
//发烧友@ALIENTEK
//技术william hill官网
:www.openedv.com
//收发都做在一个函数里面,通过按键来确定进入发送模式,还是接收模式
int main(void)
{
// u8 key,mode;
u16 wqh_times=4800;
u8 t=0;
u8 tmp_buf[33];
Stm32_Clock_Init(9);//系统时钟设置
delay_init(72); //延时初始化
uart_init(72,9600); //串口1初始化
delay_ms(200);
LCD_Init(); //初始化液晶
delay_ms(200);
KEY_Init(); //按键初始化
LED_Init(); //LED初始化
NRF24L01_Init(); //初始化NRF24L01
POINT_COLOR=RED;//设置字体为红色
LCD_ShowString(30,50,200,16,16,"WarShip STM32");
LCD_ShowString(30,70,200,16,16,"NRF24L01 TEST");
LCD_ShowString(30,90,200,16,16,"ATOM@ALIENTEK");
LCD_ShowString(30,110,200,16,16,"2015/1/17");
while(NRF24L01_Check())//检测不到24L01
{
LCD_ShowString(30,130,200,16,16,"NRF24L01 Error");
delay_ms(500);
LCD_Fill(30,130,239,130+16,WHITE);
delay_ms(500);
LED0=!LED0;//DS0闪烁
}
// LCD_ShowString(60,130,"24L01 Ready!");
// LCD_ShowString(10,150,"KEY0:RX_Mode KEY1:TX_Mode");
LCD_Fill(10,150,240,166,WHITE);//清空上面的显示
POINT_COLOR=BLUE;//设置字体为蓝色
{
LCD_ShowString(30,150,200,16,16,"NRF24L01 RX_Mode");
LCD_ShowString(30,170,200,16,16,"Received DATA:");
NRF24L01_RX_Mode();
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,tmp_buf);
for(t=0;t<16;t++)
LCD_ShowString(0,190,lcddev.width-1,32,16,tmp_buf);
wqh_times++;
}
}
}
}
然后接收端最后数据显示在LCD上程序编译不通过,不知道怎么解决了,求助。
#include "stm32f10x.h"
#include "sys.h"
#include "usart.h"
#include "delay.h"
#include "led.h"
#include "key.h"
#include "exti.h"
#include "wdg.h"
#include "timer.h"
#include "lcd.h"
#include "rtc.h"
#include "wkup.h"
#include "adc.h"
#include "dma.h"
#include "24cxx.h"
//#include "flash.h"
#include "touch.h"
#include "24l01.h"
//Mini STM32开发板范例代码19
//无线通信实验
//发烧友@ALIENTEK
//技术william hill官网
:www.openedv.com
//收发都做在一个函数里面,通过按键来确定进入发送模式,还是接收模式
int main(void)
{
// u8 key,mode;
u16 wqh_times=4800;
u8 t=0;
u8 tmp_buf[33];
Stm32_Clock_Init(9);//系统时钟设置
delay_init(72); //延时初始化
uart_init(72,9600); //串口1初始化
delay_ms(200);
LCD_Init(); //初始化液晶
delay_ms(200);
KEY_Init(); //按键初始化
LED_Init(); //LED初始化
NRF24L01_Init(); //初始化NRF24L01
POINT_COLOR=RED;//设置字体为红色
LCD_ShowString(30,50,200,16,16,"WarShip STM32");
LCD_ShowString(30,70,200,16,16,"NRF24L01 TEST");
LCD_ShowString(30,90,200,16,16,"ATOM@ALIENTEK");
LCD_ShowString(30,110,200,16,16,"2015/1/17");
while(NRF24L01_Check())//检测不到24L01
{
LCD_ShowString(30,130,200,16,16,"NRF24L01 Error");
delay_ms(500);
LCD_Fill(30,130,239,130+16,WHITE);
delay_ms(500);
LED0=!LED0;//DS0闪烁
}
// LCD_ShowString(60,130,"24L01 Ready!");
// LCD_ShowString(10,150,"KEY0:RX_Mode KEY1:TX_Mode");
LCD_Fill(10,150,240,166,WHITE);//清空上面的显示
POINT_COLOR=BLUE;//设置字体为蓝色
{
LCD_ShowString(30,150,200,16,16,"NRF24L01 RX_Mode");
LCD_ShowString(30,170,200,16,16,"Received DATA:");
NRF24L01_RX_Mode();
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,tmp_buf);
for(t=0;t<16;t++)
LCD_ShowString(0,190,lcddev.width-1,32,16,tmp_buf);
wqh_times++;
}
}
}
}
举报