Étape 5: Logiciel de récepteur :
#include < Servo.h >
#include < SPI.h >
#include « RF24.h »
Servo myservo ;
SCK -> 13 / / MISO -> 12 / / MOSI -> 11 / / CSN -> 7 / / CE -> 8
RF24 radio(8,7) ;
const uint64_t tuyau = 0xE8E8F0F0E1LL ;
int msg [1] ;
void setup()
{
myservo.Attach(9) ;
radio.Begin() ;
radio.openReadingPipe(1,pipe) ;
radio.startListening() ;
}
void loop()
{
Si (radio.available())
{
bool = false ;
tandis que (! fait)
{
fait = radio.read (EMG, 1) ;
myservo.Write (msg[0]) ;
}
} Servo.h >}