Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added files for arduino-cli and simpler arduino compiling #126

Open
wants to merge 3 commits into
base: arduino
Choose a base branch
from

Conversation

FStefanni
Copy link

@FStefanni FStefanni commented Apr 4, 2022

Hi,

this pr proposes the following improvements:

  1. Now it is possible to install via Arduino/Arduino-cli thanks to the inclusion of library.properties file
  2. Also, to allow this kind of installation, I added the src/PN532_LIB.h
  3. I also fixed some wrong includes in the other files
  4. Added a missing return statement
  5. Fixed a wrong return statement (wrong: <, correct: <=)

It is possible to use everything as before, but if the library is installied via Arduino/Arduino-cli , the new usage is the following:

  1. Include PN532_LIB.h wherever you need, choosing also the communication protocol, for example:
// Here we choose the I2C protocol:
//#define PN532_USE_HSU 1
#define PN532_USE_I2C 1
//#define PN532_USE_SPI 1
//#define PN532_USE_SWHSU 1
#include <PN532_LIB.h>
  1. In just one .ino/.cpp file, include the implementation:
// We must always choose the same protocol, so let's continue with I2C in this example:
//#define PN532_USE_HSU 1
#define PN532_USE_I2C 1
//#define PN532_USE_SPI 1
//#define PN532_USE_SWHSU 1
// And here we include the implementation:
#define PN532_INCLUDE_IMPLEMENTATION 1
#include <PN532_LIB.h>

Regards

@Cincinnatu
Copy link

Hello. I will check soon whether this is effective and reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PN532 Label for PN532 Pull request Label for pull requests UAY Unassigned yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

3 participants