6

Most programs follow this route: They have a Serial.begin() for the serial connection between PC and Arduino (the serial monitor) and they use SoftwareSerial for a device.

Can you go the other way around? Can you use SoftwareSerial for the communication between PC and Arduino, and Serial for a device?

Greenonline
  • 3,152
  • 7
  • 36
  • 48
user1584421
  • 1,425
  • 3
  • 26
  • 36

2 Answers2

3

Short answer: no.

Pins 0 and 1 an an Uno are directly wired to the PC communication chip. You could make a board that was wired differently and connected SoftwareSerial to the PC, but you would have to switch it back to pins 0 and 1 when uploading to the arduino somehow.

On an arduino leonardo "Serial" for communicating with PC over USB is different from "Serial1", which is connected to pins 0 and 1 on the board. You can use both simultaneously, so if you really need to use hardware serial and PC comms at the same time, I recommend you buy a leonardo.

BrettFolkins
  • 4,441
  • 1
  • 15
  • 26
2

Yes you can. If you use a USB FTDI type cable to connect your computer to the SoftwareSerial pins, you can use a terminal emulator program (HyperTerm, putty, etc) to communicate with the Arduino.

imjosh
  • 518
  • 2
  • 5