Created
October 1, 2021 11:09
-
-
Save 2xAA/d4c057d99ff3f5ee1efa670abf5a9e73 to your computer and use it in GitHub Desktop.
Alternate firmware for genMDM devices to work as a Port 2 Serial cable for rhargreaves/mega-drive-midi-interface
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SoftwareSerial.h> | |
SoftwareSerial softSerial(11, 2); | |
void setup() | |
{ | |
Serial.begin(115200); | |
while (!Serial) { | |
; // wait for serial port to connect. Needed for Native USB only | |
} | |
softSerial.begin(4800); | |
} | |
void loop() | |
{ | |
if (Serial.available()) { // If anything comes in Serial (USB), | |
softSerial.write(Serial.read()); // read it and send it out softSerial (pins 11 & 2) | |
} | |
if (softSerial.available()) { // If anything comes in softSerial (pins 11 & 2) | |
Serial.write(softSerial.read()); // read it and send it out Serial (USB) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment