Last active
December 28, 2019 13:58
-
-
Save ma2shita/34ef0357678164bd7d20526068fa1bea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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