Arduino connected to HC-05 and Computer and taking Data from both

Hello, I bought an Hc-05 module and it's working great so far. I would like my Uno to be able to take informations from both, my computer and the Hc-05.

I read that the Uno can handle two Serial connections and I already found THIS aswell.

What I'm unsure about is how I need to change the code to make it applicable for me, since one of the serials is running over the USB-Port and not some pins.

Thanks in advance

Your computer is connected to the hardware serial port. Use the SoftSerial library to talk to the HC-05. That will allow you to use different pins.

blh64:
Your computer is connected to the hardware serial port. Use the SoftSerial library to talk to the HC-05. That will allow you to use different pins.

Which pins on the UNO are eligible apart from 10&11?

The Uno uses pins 0 and 1 for HardwareSerial. An other pins can be used for SoftwareSerial.

...R
Serial Input Basics - simple reliable ways to receive data.

Robin2:
The Uno uses pins 0 and 1 for HardwareSerial. An other pins can be used for SoftwareSerial.

...R
Serial Input Basics - simple reliable ways to receive data.

Welp, I got it to work. The example code I used as a template apparently confused RX and TX-Pins in the declaration of the software serial....

Off topic: Can I power the arduino over the USB-Port AND the Vin at the same time? Will it automatically switch sources or would that fry it?

Hi!
When reading the questions issued by Delsey I found gold in the links/tips You gave him, Robin2.
The "Serial Input Basics" contains what I have been coding for 45 years but in very different environments. In the world of Arduino syntax, funcion names etc are slightly different, different enough to create compiler errors or malfunctions. Thanks a lot for Your work! Your links and examples will be locked up in my safe.

Delsey:
Off topic: Can I power the arduino over the USB-Port AND the Vin at the same time? Will it automatically switch sources or would that fry it?

You can connect to both at the same time.

...R