這個是別人寫的多通道發送端程序,更改地址,但是只有03號地址才能用為啥?- /*
- nRF24L01 Arduino Receiver接收端
- 圖表輸出版本
-
- Ansifa
- 2015/3/7
-
- 引腳接法:
- nRF24L01 Arduino UNO
- VCC <-> 3.3V
- GND <-> GND
- CE <-> D9
- CSN <-> D10
- MOSI<-> D11
- MISO<-> D12
- SCK <-> D13
- IRQ <-> 不接
- */
- #include"Multiple.h"
-
- Multiple nrf(9,10,13,11,12);//構建函數,參數分別為CE,CSN,CLK,MOSI,MISO
-
- uint8_t tx_addr[] = { 0x03, 0xFF, 0xFF, 0xFF, 0xFF};//發送地址
- uint8_t tx_data[32]={3,0,2,5,8};//發送的數據,32位
- //uint8_t channel;//接收通道
- //uint8_t tmp;
- void setup() {
- nrf.send_mode(tx_addr);//設置為發送模式,參數為發送地址
- }
-
- void loop() {
-
- tx_data[2]++;
- nrf.send(tx_addr,tx_data);//發送數據,參數:發送地址,數據
- delay(1000);
-
- }
復制代碼 |