Advertisement
Makerino

Transmitter Code

May 19th, 2019
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.30 KB | None | 0 0
  1. #include  <SPI.h>
  2. #include "nRF24L01.h"
  3. #include "RF24.h"
  4. int msg[256];
  5. RF24 radio(8,7);
  6. const uint64_t pipe = 0xE8E8F0F0E1LL;
  7.  
  8. void setup(){
  9.  Serial.begin(9600);
  10.  radio.begin();
  11.  radio.openWritingPipe(pipe);
  12.  }
  13.  
  14.  void loop(){
  15.  int x = analogRead(A0);
  16.  msg[0] = x;
  17.  radio.write(msg, 3);
  18.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement