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.
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.
So...
#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.