How to make any digital pin a tx or rx pin

How to make any digital pin a tx or rx pin ? Can it be a normal pin or it has to be pwm? (I need to connect 2 bluetooth modules)

1 Like

what Arduino board?

First thing to know is: use real hardware Tx & Rx pins if you can. Get an Arduino board with as many hardware Tx/Rx pins as you need. Making ordinary digital pins into Tx/Rx pins means using software to emulate hardware Tx/Rx pins, which is inferior in many ways. For example, the Arduino cannot receive data on 2 software Rx pins at the same time. If data messages arrive at the same time at both pins, one message will be lost or garbled.

To make software emulated TX/Rx pins, you need to use one of the software serial libraries. There are several versions available so learn about the advantages and limitations of each before you choose which to use. The pins do not need to be PWM pins.

Thanks and noted

Uno

Just out of curiosity:

Why do you need two Bluetooth modules?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.