Comments (5)
Hello @openmotion
have you adapted the ReadTag example to use the proper GPIOs for RX and TX? By default the example uses Serial1 which by default uses GPIO3 and GPIO1 for RX and TX. However on M5Paper different GPIOs are used on port C (UART). Check the sticker on the back of your M5Paper.
Good luck!
Thanks
Felix
from m5epd.
on the sticker i have : G, 5V TXT, G18, G19
how can i adapt the code ?
i tried with :
Serial1.begin(9600, SERIAL_8N1, 18, 19);
but no change ...
the full code :
`#include <NfcAdapter.h>
#include <PN532/PN532/PN532.h>
#include <M5EPD.h>
#include "driver/gpio.h"
#include "driver/adc.h"
#include <PN532/PN532_HSU/PN532_HSU.h>
//HardwareSerial Serial1(1);
PN532_HSU pn532hsu(Serial1);
NfcAdapter nfc(pn532hsu);
void setup(void) {
M5.begin();
Serial1.println("NDEF begin");
delay(5000);
Serial1.begin(9600);
//Wire.begin(18, 19);
Serial1.println("NDEF Reader");
nfc.begin();
}
void loop(void) {
SERIAL.println("\nScan a NFC tag\n");
if (nfc.tagPresent()) {
NfcTag tag = nfc.read();
tag.print();
}
//delay(5000);
M5.update();
delay(100);
}`
from m5epd.
another test
`#include <NfcAdapter.h>
#include <PN532/PN532/PN532.h>
#include <M5EPD.h>
#include <PN532/PN532_SWHSU/PN532_SWHSU.h>
#include "SoftwareSerial.h"
//HardwareSerial Serial1(1);
SoftwareSerial SWSerial(19, 18);
PN532_SWHSU pn532swhsu(SWSerial);
NfcAdapter nfc(pn532swhsu);
void setup(void) {
M5.begin();
Serial1.println("NDEF begin");
//delay(5000);
Serial1.begin(9600);
Serial1.println("NDEF Reader");
nfc.begin();
}
void loop(void) {
SERIAL.println("\nScan a NFC tag\n");
if (nfc.tagPresent()) {
NfcTag tag = nfc.read();
tag.print();
}
//delay(5000);
M5.update();
delay(100);
}`
from m5epd.
Hello @openmotion
sorry, I am not sure myself how this can be achieved with the NFC library. But I think you'll find a hint here.
Check out section "Step 5. Modify the code as below to enable UART communication." but try SoftwareSerial with the correct GPIOs.
Sorry I am not more of a help - but I lack the necessary hardware to try it out myself.
Good luck!
Felix
from m5epd.
thanks @felmue
i tried this method but no luck
`#include <NfcAdapter.h>
#include <PN532/PN532/PN532.h>
#include <M5EPD.h>
#include <PN532/PN532_SWHSU/PN532_SWHSU.h>
#include "SoftwareSerial.h"
//HardwareSerial Serial1(1);
#define RX_PIN 18
#define TX_PIN 19
#define BAUD_RATE 57600
SoftwareSerial SWSerial(18, 19);
PN532_SWHSU pn532swhsu(SWSerial);
NfcAdapter nfc(pn532swhsu);
void setup(void) {
M5.begin();
Serial1.println("NDEF begin");
//delay(5000);
Serial1.begin(9600, SWSERIAL_8N1,RX_PIN, TX_PIN);
// Serial1.begin(BAUD_RATE, RX_PIN, TX_PIN, SWSERIAL_8N1, false, 95, 11);
Serial1.println("NDEF Reader");
nfc.begin();
}
void loop(void) {
SERIAL.println("\nScan a NFC tag\n");
if (nfc.tagPresent()) {
NfcTag tag = nfc.read();
tag.print();
}
//delay(5000);
M5.update();
delay(100);
}`
from m5epd.
Related Issues (20)
- Image2gray.py alternative version with more "features" HOT 3
- BM8563 wakeup from time HOT 3
- Random crash when drawing PNG at src/utility/pngle.c:859 HOT 1
- M5EPD_Canvas copy / assignment causes crash. HOT 2
- the shutdown() function isn't working for me. HOT 3
- Confusion about power modes HOT 2
- textWidth return 0 if TTF loaded HOT 1
- QR Code - Core 1 panic : when size > 26. HOT 1
- Deep sleep support HOT 1
- Arduino Compile Errors HOT 1
- TextWrap doesn't seem to work HOT 1
- Please make a new release of this Library HOT 2
- Mac OS Big Sur serial issue tracked down to USB controller: NOT CP2104 but CH9102 HOT 5
- How to get/calculate battery status? HOT 1
- M5EPD.cpp error HOT 3
- Q: What is the correct BMP bitmap format? HOT 3
- M5paper stuck in - M5EPD initializing...OK - loop HOT 4
- GT911 - Interrupt disabling causes target reset HOT 1
- How to use unified library and power functions with Paper EPD HOT 3
- Cannot do simple stuff like invert text or create touch button HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from m5epd.