Étape 4: Émetteur Software :
#include < SPI.h >
#include « RF24.h »
int msg [1] ; SCK -> 13 / / MISO -> 12 / / MOSI -> 11 / / CSN -> 7 / / CE -> 8
RF24 radio(8,7) ;
const uint64_t tuyau = 0xE8E8F0F0E1LL ;
int potpin = 0 ;
int val ;
Sub setup(void)
{
radio.Begin() ;
radio.openWritingPipe(pipe) ;
}
Sub loop(void)
{
Val = analogRead(potpin) ;
Val = carte (val, 0, 1023, 0, 179) ;
msg [0] = val ;
radio.Write (EMG, 1) ;
}