#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
byte addresses[][
6
] = {
"1Node"
,
"2Node"
};
RF24
radio
(7,8)
;
bool
radioNumber =
1
;
bool
role =
0
;
/**********************************************************/
void
setup
()
{
Serial.begin(
115200
);
Serial.println(F(
"RF24/examples/GettingStarted"
));
Serial.println(F(
"*** PRESS 'T' to begin transmitting to the other node"
));
radio.begin();
radio.setChannel(
108
);
radio.setPALevel(RF24_PA_MIN);
if
(radioNumber){
radio.openWritingPipe(addresses[
1
]);
radio.openReadingPipe(
1
,addresses[
0
]);
}
else
{
radio.openWritingPipe(addresses[
0
]);
radio.openReadingPipe(
1
,addresses[
1
]);
}
radio.startListening();
}
void
loop
()
{
...
...
}
27 / 51
Nano
Содержание nRF24L01
Страница 3: ...3 51...
Страница 4: ...Introduction 4 51...
Страница 7: ...Pin Map 7 51...
Страница 9: ...Preparation Getting Started 9 51...
Страница 11: ...RF24 Library 11 51...
Страница 12: ...RF24 Library 12 51...
Страница 13: ...First Node NodeMCU 13 51...
Страница 14: ...First Node NodeMCU 14 51...
Страница 15: ...Second Node Nano 15 51...
Страница 16: ...Second Node Nano 16 51...
Страница 17: ...Code Play Getting Started 17 51...
Страница 18: ...Simple Transmit Receive NodeMCU Transmit Nano Receive Ref Example Sketches 18 51...
Страница 23: ...RF24 Sample Code 23 51...
Страница 24: ...RF24 Sample Code GettingStarted 24 51...
Страница 30: ...Simple Remote Control 30 51...
Страница 31: ...NodeMCU Remote Controller 31 51...
Страница 32: ...Nano Local Controller 32 51...
Страница 33: ...Simple Remote Control 33 51...
Страница 38: ...Simple Remote Control 38 51...
Страница 39: ...Nano Attach a Device 39 51...
Страница 40: ...Nano Attach a Device 40 51...
Страница 41: ...Connecting to Blynk Cloud Gateway 41 51...
Страница 44: ...Blynk Button with Virtual Pin V1 44 51...
Страница 46: ...Refs Resources 46 51...
Страница 48: ...NodeMCU V1 0 Pin Map 48 51...
Страница 49: ...Nano V3 0 Pin Map 49 51...
Страница 50: ...Nano V3 0 Pin Map 50 51...
Страница 51: ...51 51 END Eueung Mulyana https eueung github io 012017 nrf24 CodeLabs Attribution ShareAlike CC BY SA...