![](/media/cache/profiles/ndu.jpg.50x50_q85.jpg)
NFC03A1 demo ISO15693 tags
main.cpp@0:cf083410d646, 2018-11-08 (annotated)
- Committer:
- duchonic
- Date:
- Thu Nov 08 08:06:56 2018 +0000
- Revision:
- 0:cf083410d646
only ISO15693 tags
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
duchonic | 0:cf083410d646 | 1 | #include "mbed.h" |
duchonic | 0:cf083410d646 | 2 | #include "main.h" |
duchonic | 0:cf083410d646 | 3 | #include <CR95HF.h> |
duchonic | 0:cf083410d646 | 4 | |
duchonic | 0:cf083410d646 | 5 | DigitalOut ledMain(D13); |
duchonic | 0:cf083410d646 | 6 | Serial pcDevice(USBTX, USBRX); |
duchonic | 0:cf083410d646 | 7 | |
duchonic | 0:cf083410d646 | 8 | Thread thread; |
duchonic | 0:cf083410d646 | 9 | |
duchonic | 0:cf083410d646 | 10 | /** |
duchonic | 0:cf083410d646 | 11 | * @brief thread for nfc stuff |
duchonic | 0:cf083410d646 | 12 | */ |
duchonic | 0:cf083410d646 | 13 | void nfc_thread() |
duchonic | 0:cf083410d646 | 14 | { |
duchonic | 0:cf083410d646 | 15 | CR95HF nfcDevice(D8,D2); |
duchonic | 0:cf083410d646 | 16 | nfcDevice.Init(); |
duchonic | 0:cf083410d646 | 17 | |
duchonic | 0:cf083410d646 | 18 | while (true) { |
duchonic | 0:cf083410d646 | 19 | nfcDevice.ConfigManagerTagHunting(); |
duchonic | 0:cf083410d646 | 20 | wait(0.5); |
duchonic | 0:cf083410d646 | 21 | } |
duchonic | 0:cf083410d646 | 22 | } |
duchonic | 0:cf083410d646 | 23 | |
duchonic | 0:cf083410d646 | 24 | |
duchonic | 0:cf083410d646 | 25 | |
duchonic | 0:cf083410d646 | 26 | int main() |
duchonic | 0:cf083410d646 | 27 | { |
duchonic | 0:cf083410d646 | 28 | pcDevice.baud(115200); |
duchonic | 0:cf083410d646 | 29 | |
duchonic | 0:cf083410d646 | 30 | pcDevice.printf("--- Startup NFC Demo ---\r\n"); |
duchonic | 0:cf083410d646 | 31 | |
duchonic | 0:cf083410d646 | 32 | thread.start(nfc_thread); |
duchonic | 0:cf083410d646 | 33 | |
duchonic | 0:cf083410d646 | 34 | while (true) { |
duchonic | 0:cf083410d646 | 35 | ledMain = !ledMain; |
duchonic | 0:cf083410d646 | 36 | wait(0.2); |
duchonic | 0:cf083410d646 | 37 | } |
duchonic | 0:cf083410d646 | 38 | } |