node.jsarduinorfidfirmatajohnny-five

Use external C++ library with Johnny Five for Arduino based projects


I need to use the RFID-RC522 module in my Johnny Five project (it is an NFC reader).

There is an arduino Library that makes it easy to interface with that: https://github.com/miguelbalboa/rfid

Can i use this library through Johnny-Five? If yes, how?


Solution

  • Short answer: Yes.

    Long answer: You'll need some work.

    JohnnyFive uses Firmata to interact with Arduino. Firmata is a program you upload on the Arduino that will allow you to interface it easily with your computer using different languages such as Python, JS, C/C++ and so on.

    Your problem is that you cannot have Firmata and a custom program using the RFID library on your Arduino at the same time.

    So you have to choices:

    The second solution will be easier and simpler if you don't need Johnny five.

    As you said you are new to Arduino Programming, I would advise you to start small with just Arduino code before moving to Arduino+JS.

    Hope this helps :)