Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

arduino and nRF24L01+ and Nordic Fob

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
435 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Aug 28, 2011

I had a hard time getting this to work even with examples on the the arduino forum. It seems that it needs the command Mirf.spi = &MirfHardwareSpi; to get going. Anyway, the purpose of this vid is to post the code to help other idiots like myself:
** notes its a standard config:
MISO = 12 , MOSI = 11 , SCK = 13 , CE = 8 , CSN = 7
The VCC is direct to 5v on the ardiono and GND to GND of course.

// note you need to put the arrows around these 4 #include as youtube wont allow this character in the desc for some reason.
#include SPI.h
#include Mirf.h
#include nRF24L01.h
#include MirfHardwareSpiDriver.h


byte data_array[4];

void setup() {
Mirf.spi = &MirfHardwareSpi;
Mirf.csnPin = 7;
Mirf.cePin = 8; Mirf.init();
// delay(50); Mirf.setRADDR(rx_addr);
Mirf.configRegister(RF_SETUP, 0x07); //Air data rate 1Mbit, 0dBm, Setup LNA
Mirf.configRegister(EN_AA, 0x00); //Disable auto-acknowledge
Mirf.payload = 4;
Mirf.channel = 2;
Mirf.config();
Serial.begin(9600);
}

void loop(){ if (Mirf.dataReady()){ Serial.print("Data! : "); Mirf.getData(data_array); Serial.println(data_array[0],HEX); switch (data_array[0]) {
case 0x1D: Serial.println("UP"); break;
case 0x1E: Serial.println("DOWN"); break;
case 0x17: Serial.println("LEFT"); break;
case 0x1B: Serial.println("RIGHT"); break;
case 0x0F: Serial.println("CENTER"); break;
default: break; }
}
}

good pages from arduino:
http://www.arduino.cc/playground/InterfacingWithHardware/Nrf24L01, you only need Mirf.h download from this page as the other .h files (nRF24L01.h , MirfHardwareSpiDriver.h ) are inside Mirf.h

Whats this program do: Simply press the FOB and get word 'UP', press down 'DOWN'...e.t.c. outputted to your computer (press serial monitor button after you upload the program)

Category:

Entertainment

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:
see all

All Comments (2)

Sign In or Sign Up now to post a comment!
  • any luck finding your file?

  • Tried using the code exactly as you posted, I am using the same fob but the nRF24L01+ Module with RP-SMA connector. would not work at all, is the line // delay(50); Mirf.setRADDR(rx_addr);

    supposed to be commented? i uncommented the second half but would not compile as rx_addr is not defined.

    is Mirf.setRADDR meant to point to the data array?

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more