Advertisement
alexpetro000

Untitled

Dec 28th, 2015
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <SPI.h>
  2. #include <nRF24L01.h>
  3. #include <RF24.h>
  4.  
  5. #define CE_PIN   9
  6. #define CSN_PIN 10
  7.  
  8. const uint64_t pipe = 0xE8E8F0F0E1LL;
  9. RF24 radio(CE_PIN, CSN_PIN);
  10.  
  11. int pack[7];
  12.  
  13. void setup()
  14. {
  15.  
  16.   delay(1000);
  17.  
  18.   radio.begin();
  19.   radio.openReadingPipe(1, pipe);
  20.   radio.startListening();
  21. }
  22.  
  23.  
  24. void loop()
  25. {
  26.   if (radio.available()) {
  27.     radio.read( joystick, sizeof(joystick) );
  28.     for(int i=0; i<7; i++) {
  29.      Serial.println(joystick[i]);
  30.    }
  31.  }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement