Uno: SoftwareSerial -> to -> Due: HardwareSerial?

I have some code running on the Uno using ‘software serial’ for doing MIDI on and Adafruit MusicMaker sheild. I want to move it over to a Due, but there is not Software Serial library for the Due. So for some reason I don’t know what to do that. (I feel like this is a very stupid question).

For the Uno code I have:

#include <SoftwareSerial.h>

SoftwareSerial VS1053_MIDI(0, 2); // using pin2 for transmit

For the Due code I want??
#include <HardwareSerial.h>
Serial2 VS1053_MIDI; // hardware serial pins pre-defined hard-wired pins.

Clearly my Due code isn’t correct…


There is software serial for DUE and usage is the same as on uno.

If You want to define hardware serial - just do:

void setup() {

void loop() {
  Serial.println("hello world");

Thanks. I realized that, first, my Serial2 line didn’t make sense. (Because Serial2 is not a type). And the quick fix to my issue was to use a #define to make VS1053_MIDI point to Serial2. The the rest of the code didn’t need to be re-written.


#include <HardwareSerial.h>
#define VS1053_MIDI Serial1 // hardware serial pins pre-defined hard-wired pins, in the case pin 18.

I also needed this:

#define VS1052_RX 18 // the pin number is needed in the Adafruit exmaple code.

Works great!