Made RS422 to USB passtrought, works both ways now.
This commit is contained in:
@@ -109,8 +109,8 @@ void setup() { // BEGIN SETUP ------------------------------------
|
|||||||
|
|
||||||
display.setTextSize(2); // Set text size on the display
|
display.setTextSize(2); // Set text size on the display
|
||||||
display.setTextColor(WHITE); // Set text color on the display
|
display.setTextColor(WHITE); // Set text color on the display
|
||||||
display.setCursor(36,22); // Set the display cursor to position
|
display.setCursor(36,18); // Set the display cursor to position
|
||||||
display.println("NMM-1"); // Print on display
|
display.println("NMA-1"); // Print on display
|
||||||
display.display(); // Refresh display
|
display.display(); // Refresh display
|
||||||
delay(3000);
|
delay(3000);
|
||||||
display.clearDisplay(); // Clean display
|
display.clearDisplay(); // Clean display
|
||||||
@@ -389,14 +389,14 @@ void one (void)
|
|||||||
display.clearDisplay(); // Clean display
|
display.clearDisplay(); // Clean display
|
||||||
display.setTextSize(1); // Set text size on the display
|
display.setTextSize(1); // Set text size on the display
|
||||||
display.setTextColor(WHITE); // Set text color on the display
|
display.setTextColor(WHITE); // Set text color on the display
|
||||||
display.setCursor(1,22); // Set the display cursor to position
|
display.setCursor(1,18); // Set the display cursor to position
|
||||||
display.println("Send GPS <--"); // Print on display
|
display.println("Send GPS <--"); // Print on display
|
||||||
display.setCursor(1,32); // Set the display cursor to position
|
display.setCursor(1,28); // Set the display cursor to position
|
||||||
display.println("Send Heading"); // Print on display
|
display.println("Send Heading"); // Print on display
|
||||||
display.setCursor(1,42); // Set the display cursor to position
|
display.setCursor(1,38); // Set the display cursor to position
|
||||||
display.println("Send Depth"); // Print on display
|
display.println("Send Depth"); // Print on display
|
||||||
display.setCursor(1,52); // Set the display cursor to position
|
display.setCursor(1,48); // Set the display cursor to position
|
||||||
display.println("RS422 ==> USB"); // Print on display
|
display.println("RS422 <==> USB"); // Print on display
|
||||||
batt_icon(); // call function batt_icon()
|
batt_icon(); // call function batt_icon()
|
||||||
display.display(); // Refresh display
|
display.display(); // Refresh display
|
||||||
}
|
}
|
||||||
@@ -406,14 +406,14 @@ void two (void)
|
|||||||
display.clearDisplay(); // Clean display
|
display.clearDisplay(); // Clean display
|
||||||
display.setTextSize(1); // Set text size on the display
|
display.setTextSize(1); // Set text size on the display
|
||||||
display.setTextColor(WHITE); // Set text color on the display
|
display.setTextColor(WHITE); // Set text color on the display
|
||||||
display.setCursor(1,22); // Set the display cursor to position
|
display.setCursor(1,18); // Set the display cursor to position
|
||||||
display.println("Send GPS"); // Print on display
|
display.println("Send GPS"); // Print on display
|
||||||
display.setCursor(1,32); // Set the display cursor to position
|
display.setCursor(1,28); // Set the display cursor to position
|
||||||
display.println("Send Heading <--"); // Print on display
|
display.println("Send Heading <--"); // Print on display
|
||||||
display.setCursor(1,42); // Set the display cursor to position
|
display.setCursor(1,38); // Set the display cursor to position
|
||||||
display.println("Send Depth"); // Print on display
|
display.println("Send Depth"); // Print on display
|
||||||
display.setCursor(1,52); // Set the display cursor to position
|
display.setCursor(1,48); // Set the display cursor to position
|
||||||
display.println("RS422 ==> USB"); // Print on display
|
display.println("RS422 <==> USB"); // Print on display
|
||||||
batt_icon(); // call function batt_icon()
|
batt_icon(); // call function batt_icon()
|
||||||
display.display(); // Refresh display
|
display.display(); // Refresh display
|
||||||
}
|
}
|
||||||
@@ -423,14 +423,14 @@ void three (void)
|
|||||||
display.clearDisplay(); // Clean display
|
display.clearDisplay(); // Clean display
|
||||||
display.setTextSize(1); // Set text size on the display
|
display.setTextSize(1); // Set text size on the display
|
||||||
display.setTextColor(WHITE); // Set text color on the display
|
display.setTextColor(WHITE); // Set text color on the display
|
||||||
display.setCursor(1,22); // Set the display cursor to position
|
display.setCursor(1,18); // Set the display cursor to position
|
||||||
display.println("Send GPS"); // Print on display
|
display.println("Send GPS"); // Print on display
|
||||||
display.setCursor(1,32); // Set the display cursor to position
|
display.setCursor(1,28); // Set the display cursor to position
|
||||||
display.println("Send Heading"); // Print on display
|
display.println("Send Heading"); // Print on display
|
||||||
display.setCursor(1,42); // Set the display cursor to position
|
display.setCursor(1,38); // Set the display cursor to position
|
||||||
display.println("Send Depth <--"); // Print on display
|
display.println("Send Depth <--"); // Print on display
|
||||||
display.setCursor(1,52); // Set the display cursor to position
|
display.setCursor(1,48); // Set the display cursor to position
|
||||||
display.println("RS422 ==> USB"); // Print on display
|
display.println("RS422 <==> USB"); // Print on display
|
||||||
batt_icon(); // call function batt_icon()
|
batt_icon(); // call function batt_icon()
|
||||||
display.display(); // Refresh display
|
display.display(); // Refresh display
|
||||||
}
|
}
|
||||||
@@ -440,14 +440,14 @@ void four (void)
|
|||||||
display.clearDisplay(); // Clean display
|
display.clearDisplay(); // Clean display
|
||||||
display.setTextSize(1); // Set text size on the display
|
display.setTextSize(1); // Set text size on the display
|
||||||
display.setTextColor(WHITE); // Set text color on the display
|
display.setTextColor(WHITE); // Set text color on the display
|
||||||
display.setCursor(1,22); // Set the display cursor to position
|
display.setCursor(1,18); // Set the display cursor to position
|
||||||
display.println("Send GPS"); // Print on display
|
display.println("Send GPS"); // Print on display
|
||||||
display.setCursor(1,32); // Set the display cursor to position
|
display.setCursor(1,28); // Set the display cursor to position
|
||||||
display.println("Send Heading"); // Print on display
|
display.println("Send Heading"); // Print on display
|
||||||
display.setCursor(1,42); // Set the display cursor to position
|
display.setCursor(1,38); // Set the display cursor to position
|
||||||
display.println("Send Depth"); // Print on display
|
display.println("Send Depth"); // Print on display
|
||||||
display.setCursor(1,52); // Set the display cursor to position
|
display.setCursor(1,48); // Set the display cursor to position
|
||||||
display.println("RS422 ==> USB <--"); // Print on display
|
display.println("RS422 <==> USB <--"); // Print on display
|
||||||
batt_icon(); // call function batt_icon()
|
batt_icon(); // call function batt_icon()
|
||||||
display.display(); // Refresh display
|
display.display(); // Refresh display
|
||||||
}
|
}
|
||||||
@@ -458,6 +458,11 @@ void read_serial (void)
|
|||||||
{
|
{
|
||||||
Serial.write(mySerial.read()); // redirect it to USB
|
Serial.write(mySerial.read()); // redirect it to USB
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Serial.available()) // If incoming NMEA0183 serial
|
||||||
|
{
|
||||||
|
mySerial.write(Serial.read()); // redirect it to USB
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void write_gps (void)
|
void write_gps (void)
|
||||||
|
Reference in New Issue
Block a user