From d5d6a4bffed7670622ea0d2649d8b99e0e727957 Mon Sep 17 00:00:00 2001 From: Ricardo_lap Date: Thu, 13 Dec 2018 21:28:04 +0000 Subject: [PATCH] Made RS422 to USB passtrought, works both ways now. --- firmware/v01/v01.ino | 49 ++++++++++++++++++++++++-------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/firmware/v01/v01.ino b/firmware/v01/v01.ino index 3e1ef24..5e3979d 100644 --- a/firmware/v01/v01.ino +++ b/firmware/v01/v01.ino @@ -109,8 +109,8 @@ void setup() { // BEGIN SETUP ------------------------------------ display.setTextSize(2); // Set text size on the display display.setTextColor(WHITE); // Set text color on the display - display.setCursor(36,22); // Set the display cursor to position - display.println("NMM-1"); // Print on display + display.setCursor(36,18); // Set the display cursor to position + display.println("NMA-1"); // Print on display display.display(); // Refresh display delay(3000); display.clearDisplay(); // Clean display @@ -389,14 +389,14 @@ void one (void) display.clearDisplay(); // Clean display display.setTextSize(1); // Set text size 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.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.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.setCursor(1,52); // Set the display cursor to position - display.println("RS422 ==> USB"); // Print on display + display.setCursor(1,48); // Set the display cursor to position + display.println("RS422 <==> USB"); // Print on display batt_icon(); // call function batt_icon() display.display(); // Refresh display } @@ -406,14 +406,14 @@ void two (void) display.clearDisplay(); // Clean display display.setTextSize(1); // Set text size 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.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.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.setCursor(1,52); // Set the display cursor to position - display.println("RS422 ==> USB"); // Print on display + display.setCursor(1,48); // Set the display cursor to position + display.println("RS422 <==> USB"); // Print on display batt_icon(); // call function batt_icon() display.display(); // Refresh display } @@ -423,14 +423,14 @@ void three (void) display.clearDisplay(); // Clean display display.setTextSize(1); // Set text size 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.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.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.setCursor(1,52); // Set the display cursor to position - display.println("RS422 ==> USB"); // Print on display + display.setCursor(1,48); // Set the display cursor to position + display.println("RS422 <==> USB"); // Print on display batt_icon(); // call function batt_icon() display.display(); // Refresh display } @@ -440,14 +440,14 @@ void four (void) display.clearDisplay(); // Clean display display.setTextSize(1); // Set text size 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.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.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.setCursor(1,52); // Set the display cursor to position - display.println("RS422 ==> USB <--"); // Print on display + display.setCursor(1,48); // Set the display cursor to position + display.println("RS422 <==> USB <--"); // Print on display batt_icon(); // call function batt_icon() display.display(); // Refresh display } @@ -458,6 +458,11 @@ void read_serial (void) { 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)