Skip to content

Instantly share code, notes, and snippets.

@ma2shita
Last active December 28, 2019 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ma2shita/34ef0357678164bd7d20526068fa1bea to your computer and use it in GitHub Desktop.
Save ma2shita/34ef0357678164bd7d20526068fa1bea to your computer and use it in GitHub Desktop.
/*
* Modified to Lib (`Serial` to `Serial1`)
*/
#include <WioLTEforArduino.h>
WioLTE Wio;
#define CONSOLE SerialUSB
#include <RCS620S.h>
RCS620S rcs620s;
void setup() {
delay(200);
CONSOLE.println("\n-- START");
Wio.Init();
CONSOLE.begin(115200);
Wio.PowerSupplyGrove(true);
Serial1.begin(115200); /* for Wio LTE hardware UART */
while(!rcs620s.initDevice()); /* ret=1 is failed init */
CONSOLE.println("\n-- Ready");
}
void loop() {
CONSOLE.println("\n-- loop");
if (rcs620s.polling()) {
CONSOLE.println("FeliCa detected!");
CONSOLE.print("IDm = ");
for(int i = 0; i < sizeof(rcs620s.idm) ; i++) {
char buf[2];
sprintf(buf, "%02X", rcs620s.idm[i]);
CONSOLE.print(buf);
}
CONSOLE.println();
}
rcs620s.rfOff();
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment