Possibility of using multiple baudrate in a single coding?

Hi, I have a problem in my project where as I need to use a Ardafruit Minithermal Printer and a WiFi Shield, the problem is both of them have different baudrates, as the printer uses a 19200 baudrate while the WiFi Shield uses 9600 baudrate. If I set the baudrate to 9600, the printer will only print gibberish and if I set the baudrate to 19200 the ESP cannot be connected to the WiFi. I hope you guys can guide me in this problem. The Arduino that was used is the Arduino Mega

You have to use 2 Serial devices, one for each connection. See SoftwareSerial...

ABSYR:
The Arduino that was used is the Arduino Mega

Then you have three spare hardware serial ports (pin 14-19), that you can set to different speeds.

Which WiFi shield. The shield could be using SPI (not Serial).
Leo..

Wawa:
Then you have three spare hardware serial ports (pin 14-19), that you can set to different speeds.

Which WiFi shield. The shield could be using SPI (not Serial).
Leo..

I am using Cytron Wifi Shield, I will check whether it is using SPI or not

It's a shield with an Uno form factor and ESP based.

According to the user manual, it does not use SPI for communication with the ESP.

To use one of the other hardware serial ports of the Mega, you will have to hack the shield. The alternative is SoftwareSerial (or one of the better alternatives like neoswserial).