Copy right © 2018 Shenzhen Emakefun Technology co., Ltd.
32
Mirf
.
channel
=
10
;
//Set the used channel
Mirf
.
config
();
Serial
.
println
(
"Listening..."
);
//Start listening to received data
}
void
loop
()
{
Mirf
.
ceLow
();
Mirf
.
configRegister
(
RF_CH
,
10
);
//switch channel 10
Mirf
.
ceHi
();
if
(
Mirf
.
dataReady
())
{
//When the program is received, the received data is output from
the serial port
Mirf
.
getData
((
byte
*)
&
value
);
Serial
.
(
"Receive1 got data is: "
);
Serial
.
println
(
value
);
}
delay
(
800
);
}
Data received by receiving device 1
:
Figure 3-3-2