dear sir, I tried to use UART#2 and relocate RX to pin 5 and TX to pin17. anyway the compiler shows error below.
Don't know what is wrong or what to include to code please help. thanks in advance.
board: heltec wifi kit32 (esp32 with OLED
)
best regards
Newprasertkitt
HardwareSerial mySerial2(2);
mySerial2.begin(9600,SERIAL_8N1,5,7);
sketch_Jan28_ESP32_fingerprintSS_01:10: error: 'mySerial2' does not name a type
mySerial2.begin(9600,SERIAL_8N1,5,7);
^
exit status 1
'mySerial2' does not name a type
Heltec wifi kit32, hardware serial
Re: Heltec wifi kit32, hardware serial
This works fine for me:
Code: Select all
HardwareSerial Pzemserial(2);
#define RXD2 16 //Gpio pins Serial2
#define TXD2 17
Pzemserial.begin(9600, SERIAL_8N1, RXD2, TXD2);
-
- Posts: 9
- Joined: Thu Dec 06, 2018 4:20 am
Re: Heltec wifi kit32, hardware serial
Hi edje11:thank you for your help,but this Pzem still got error.
mine, version arduino is 1.8.5, what is yours
best regards
newprasertkitt
exit status 1
'Pzemserial' does not name a type
mine, version arduino is 1.8.5, what is yours
best regards
newprasertkitt
exit status 1
'Pzemserial' does not name a type
-
- Posts: 9
- Joined: Thu Dec 06, 2018 4:20 am
Re: Heltec wifi kit32, hardware serial
Hi all, I got it.
just need to put the line in Setup function!.
setup {
mySerial2.begin(9600,SERIAL_8N1,5,7);
}
best regards
NewPrasertKitt
just need to put the line in Setup function!.
setup {
mySerial2.begin(9600,SERIAL_8N1,5,7);
}
best regards
NewPrasertKitt
Who is online
Users browsing this forum: No registered users and 125 guests