Main Menu

search

You are here

nRF24 Libraries

[last updated: 2020-03-21]
go to: Arduino libraries
go to: nRF24 home page
go to nRF24 libraries - pg 2
(link to:) library classes
-----

Did I say I was a newbie? Libraries remain confusing to me. However here are some things I think are true.

  • Libraries are available from link to: maniacBug
    • Follow link to github. A few hundred repositories there, libraries and other stuff about which I am clueless.
    • Found this repository: link to: github.com/maniacbug/RF24
    • Click on "Download ZIP". [Put it where?]
    • Extract and examine directory details. I see that current online version (Dec-2015) was last updated in 2013, whereas the version on my PC (Documents/Arduino/Libraries/nRF24) was updated in 2012. So I will replace my existing version with newest version.
      When un-zipped, a directory was created named "RF24-master". I renamed it, removing the "-master"
      • Things that seem (in my newbie ignorance) to be anomalies:
        Old library on my PC was in a directory named "nRF24", but new un-zipped version is in a directory named "RF24". I left it that way.
    • The nRF24 program requires a "printf.h" file, which I put into the same directory as the RF24.h and nRF24L01.h files.
  • There is also a set of libraries from RadioHead that supposedly are upgrades to maniacbug's. However my initial attempts to install and make functional were unsuccessful.
    • For one thing, manicbug has both an RF24.h and an nRF24L01.h, however RH only had RH_NRF24.h. That is, it did not have one in the main RH github repository. I did find one, however I apparently need to change the calls/methods and don't know enough to make it work. It would not compile for me.
    • RH library is available here:
      ...
    • RH overview
    • Library class ref here
    • project tutorial
    • github: unzipped RH_NRF24.h
    • TMRH20: "Optimized High-Speed nRF24L01+"
  • Both maniacbug and RH libraries allow specifying CE & CSN pin designations in your sketch, however MISO, MOSI, & SCK are specific to the particular Arduino board being used and cannot be changed. Different Arduino board types (Uno vs. Mega, eg.) use different pins for these signals.
  • When swapping different libraries for the same module, like maniacbug vs. tmrh20, it's convenient if the library files (the .h and .cpp) are named differently. Then to use one or the other you just edit your #include statements. OTOH in this case, they use the same name, so it's necessary to disable the library files that you don't want to use. I've found it is sufficient to rename the .h files eg. with a .xh extension. Then the IDE won't be able to find them.
  • Here is a great reference:
    link to: github class ref