Heltec wifi kit32, hardware serial

NewPrasertKitt
Posts: 9
Joined: Thu Dec 06, 2018 4:20 am

Heltec wifi kit32, hardware serial

Postby NewPrasertKitt » Wed Jan 30, 2019 7:12 am

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

Edje11
Posts: 18
Joined: Thu May 17, 2018 10:33 am
Contact:

Re: Heltec wifi kit32, hardware serial

Postby Edje11 » Wed Jan 30, 2019 6:53 pm

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);

NewPrasertKitt
Posts: 9
Joined: Thu Dec 06, 2018 4:20 am

Re: Heltec wifi kit32, hardware serial

Postby NewPrasertKitt » Thu Jan 31, 2019 2:48 am

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

pipi61
Posts: 13
Joined: Fri Dec 23, 2016 10:58 pm

Re: Heltec wifi kit32, hardware serial

Postby pipi61 » Fri Feb 01, 2019 11:44 pm


NewPrasertKitt
Posts: 9
Joined: Thu Dec 06, 2018 4:20 am

Re: Heltec wifi kit32, hardware serial

Postby NewPrasertKitt » Sun Feb 03, 2019 1:47 pm

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

Who is online

Users browsing this forum: No registered users and 15 guests