标题: nrf24l01与stm32f103查询接受发送程序源码 [打印本页]

作者: 假大宝剑    时间: 2018-8-20 10:28
标题: nrf24l01与stm32f103查询接受发送程序源码
24l01与stm32f1查询接受发程序源码,这个程序有祝大家学习参考24l01与stm32f1原理。


单片机源程序如下:

  1. #include "includes.h"

  2. int main()
  3. {        
  4.      u8 tmp_buf[3],i;
  5.                   
  6.         NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2); //设置NVIC中断分组2:2位抢占优先级,2位响应优先级
  7.      delay_init();                     //延时函数初始化
  8.      TIM4_Init(9,7199);//Tout(溢出时间)=(ARR+1)(PSC+1)/Tclk =10*7200/72000000s=1ms
  9.      LED_Init();
  10.         USART1_Init(115200,0);         //串口初始化为115200
  11.      delay_us(500);
  12. NRF24L01_Init();                    //初始化NRF24L01

  13.         while(NRF24L01_Check())
  14.         {
  15.                 printf("NRF24L01 Error\r\n");
  16.                  delay_ms(1000);
  17.         }
  18.        printf("NRF24L01 OK\r\n");
  19. delay_ms(1000);
  20.           NRF24L01_RX_Mode();
  21. delay_ms(1000);delay_ms(1000);
  22.                 while(1)
  23.                 {                                                              
  24.                         while(NRF24L01_RxPacket(tmp_buf)!=RX_OK)
  25.                         {
  26.                        // printf("Rx Failed\r\n");
  27.                         }
  28.                        // printf("Rx ok\r\n");
  29.                          for(i=0;i<3;i++)
  30.                             printf("%d,",tmp_buf[i]);
  31.                          printf("\r\n");
  32. //               else
  33. //                        {                                                                                                      
  34. //                                
  35. //                        }
  36.            }




  37. }


复制代码

所有资料51hei提供下载:
nrf24l01_STM32F103C8T6查询接收发.rar (900.47 KB, 下载次数: 84)




作者: renyicqupt    时间: 2019-5-24 16:18
楼主在吗?请教您这个怎么接线?




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