Created
March 10, 2021 18:57
-
-
Save rocketjosh/bcb0fb5b62fcb183b27ee2031aa0bcc7 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /* | |
| 9141 UART test - M2 | |
| */ | |
| void setup() { | |
| // initialize both serial ports: | |
| SerialUSB.begin(9600); | |
| Serial1.begin(9600); | |
| pinMode(LIN_KSLP, OUTPUT); | |
| digitalWrite(LIN_KSLP, HIGH); | |
| pinMode(PS_J1850_9141, OUTPUT); | |
| digitalWrite(PS_J1850_9141, HIGH); | |
| delay(1000); | |
| SerialUSB.println("Starting"); | |
| pinMode(LIN_KRX, INPUT_PULLUP); | |
| } | |
| void loop() { | |
| while (Serial1.available() > 0) { | |
| int inByte = Serial1.read(); | |
| SerialUSB.write(inByte); | |
| } | |
| while (SerialUSB.available() > 0) { | |
| int inByte = SerialUSB.read(); | |
| Serial1.write(inByte); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment