标题: 刚调通的nrf24l01_89C52RC查询收发源码 [打印本页]

作者: Braver1    时间: 2018-8-24 14:46
标题: 刚调通的nrf24l01_89C52RC查询收发源码
大家可以参考啊!

单片机源程序如下:
  1. #include "yxl_51\\yxl.h"
  2. #include "yxl_51\\uart.h"//测试部分
  3. #include "yxl_51\\io_spi.h"
  4. #include "yxl_51\\nrf24l01.h"
  5. #include "yxl_51\\delay.h"

  6. void delay500ms(void)   //误差 0us
  7. {
  8.     unsigned char a,b,c;
  9.     for(c=205;c>0;c--)
  10.         for(b=116;b>0;b--)
  11.             for(a=9;a>0;a--);
  12. }


  13. void main(void)
  14. {
  15.         InitUART();//测试部分
  16.      NRF24L01_Init() ;                                                        
  17.         printf("%s\n","chushihua OK.");//测试部分
  18.         LED_fasong=1;LED_jieshou=1;//熄灭两个指示灯        
  19.         TxBuf[0]=0;TxBuf[1]=1;TxBuf[2]=2;
  20.         while(NRF24L01_Check())
  21.         {
  22.                 printf("NRF24L01 Error\r\n");
  23.                  delay500ms();
  24.         }
  25.      printf("NRF24L01 OK\r\n");
  26.      NRF24L01_TX_Mode();
  27.         while(1)
  28.         {        
  29.                 TxBuf[0]++;
  30.           LED_fasong=1;
  31.                 while(NRF24L01_TxPacket(TxBuf)!=TX_OK)
  32.           {
  33.                
  34.           }
  35.           LED_fasong=0;
  36.           printf("NRF24L01 TX OK\r\n");               
  37.         }        
  38. }
复制代码

所有资料51hei提供下载:
nrf24l01_89C52RC 查询收发.rar (164.11 KB, 下载次数: 19)



作者: ▓逍〓遥◆    时间: 2018-8-28 00:02
顶!好贴,学习了




欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1