![Emakefun RF-NANO Скачать руководство пользователя страница 22](http://html1.mh-extra.com/html/emakefun/rf-nano/rf-nano_operating-instructions-manual_2398917022.webp)
Copy right © 2018 Shenzhen Emakefun Technology co., Ltd.
22
Mirf
.
spi
=
&
MirfHardwareSpi
;
Mirf
.
init
();
//Set your own address (sender address) using 5 characters
Mirf
.
setRADDR
((
byte
*)
"ABCDE"
);
Mirf
.
payload
=
sizeof
(
value
);
Mirf
.
channel
=
90
;
//Set the channel used
Mirf
.
config
();
}
void
loop
()
{
vas
=
"asc"
;
Mirf
.
setTADDR
((
byte
*)
"FGHIJ"
);
//Set the receiver address
value
=
32765
;
//random(255); //0-255 random number
Mirf
.
send
((
byte
*)
"A"
);
//Send instructions, send random number value
Serial
.
(
"Wait for sending....."
);
while
(
Mirf
.
isSending
())
delay
(
1
);
//Until you send successfully, exit the
loop
Serial
.
(
"Send success:"
);
Serial
.
println
(
value
);
delay
(
1000
);
}