SHARE
TWEET

thing for steven

a guest Jan 19th, 2020 71 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. #define button 4
  5. const uint64_t pipe = 0xE6;
  6. int SMessage[1] = {000};
  7. RF24 radio(7, 8);
  8.  
  9.  
  10. void setup() {
  11.  
  12.   pinMode(button, INPUT);
  13.   radio.begin();
  14.   radio.openWritingPipe(pipe);
  15.  
  16.   radio.setPALevel(RF24_PA_MAX);
  17. }
  18. void loop() {
  19.  
  20.   if (digitalRead(button) == HIGH) {
  21.     SMessage[0] = 111;
  22.     radio.write(SMessage, 1);
  23.   }
  24.   else {
  25.     SMessage[0] = 000;
  26.     radio.write(SMessage, 1);
  27.   }
  28.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top