I'm using arduino pro micro Atmega32u4 5v 16Mhz
I want to use it to make a HID Keyboard and Mouse but I ran out of pins so I was wondering if I can use the RX and TX pins as digital input pins. Will it work? Will it affect the communication of the arduino to the computer?
-
2Should be fine. Communication is done natively in USB with the ATmega32u4, TX and RX (D0, D1) are free for other tasks.towe– towe09/22/2020 07:49:43Commented Sep 22, 2020 at 7:49
-
1RX/TX pins on Micro are Serial1Juraj– Juraj ♦09/22/2020 11:03:15Commented Sep 22, 2020 at 11:03
-
Not a problem on the Pro Micro. You tag also mentions Pro Mini. On those it could be a problem. If your code doesn't use Serial, then there is no problem there. But there could still be a problem during uploading the code. If for example a button is connected to either pin, and this button is pressed, it could block uploading, and could even cause a short if the other side of the button is directly connected to Vcc or GND.Gerben– Gerben09/22/2020 15:45:48Commented Sep 22, 2020 at 15:45
2 Answers 2
Using TX and RX on a 32U4 does not affect PC communication. It uses a competent different communication channel.
You can use those pins for digital operation with no problems, you just won't be able to use Serial1
for communication with serial peripherals.
Welcome to ASE.
- Communication between the PC and the Arduino Pro Micro happens through the USB, unlike the Arduino Uno and Mega, which use the RX and TX lines.
- In your case, the USB pins of the Micro are used to communicate with the PC. Hence, the RX and TX pins are available for digital input and output operations.
Explore related questions
See similar questions with these tags.