diff --git a/.gitignore b/.gitignore index 6a810a0..5c10800 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ Debug/ Release/ __vm/ -.vs/ \ No newline at end of file +.vs/ +/NMEAmonitor.vcxproj +/NMEAmonitor.vcxproj.filters diff --git a/NMEAmonitor.ino b/NMEAmonitor.ino index a463498..c68aa66 100644 --- a/NMEAmonitor.ino +++ b/NMEAmonitor.ino @@ -36,8 +36,8 @@ // LCDML TYPE SELECT // ********************************************************************* // settings for lcd -#define _LCDML_DISP_cols 16 -#define _LCDML_DISP_rows 2 +#define _LCDML_DISP_cols 20 +#define _LCDML_DISP_rows 4 #define PAGE_DISPLAY 3 // each page is displayed 3 sec #define INITIAL_BACKLIT 100 // initial backlit value @@ -52,8 +52,8 @@ #define PAGECOUNT 13 // number of pages to be displayed -#define PROG_NAME "N2K Monitor+TX " -#define PROG_VER "19.10.2018 v1.01" +#define PROG_NAME "N2K Monitor " +#define PROG_VER "29.11.2018 v1.02" #define SHOW_NAME_VER 4 // show name and version for 4 sec static int flag[PAGECOUNT] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}; @@ -176,6 +176,8 @@ static double AWA_disp; static double AWArel_disp; static double AWD_disp; +static int row; + typedef struct { unsigned char second; // 0-59 @@ -233,13 +235,21 @@ Stream *OutputStream; OutputStream = &Serial; #endif - NMEA2000.SetForwardStream(&Serial); +// to use the alternative can0 with Tindie CAN-Bus Adapter, set High speed mode + pinMode(28, OUTPUT); + digitalWrite(28, LOW); + +// to use the can0 with Tindie CAN-Bus Adapter, set High speed mode + pinMode(2, OUTPUT); + digitalWrite(2, LOW); + + NMEA2000.SetForwardStream(&Serial); //NMEA2000.SetForwardType(tNMEA2000::fwdt_Text); // Show in clear text. Leave commented for default Actisense format. NMEA2000.SetForwardOwnMessages(); // If you also want to see all traffic on the bus use N2km_ListenAndNode instead of N2km_NodeOnly below - NMEA2000.SetMode(tNMEA2000::N2km_ListenAndNode, 23); // 23=SRC-Addr on N2K-Bus - // NMEA2000.EnableForward(false); // Disable all msg forwarding to USB (=Serial) + NMEA2000.SetMode(tNMEA2000::N2km_ListenAndNode, 22); // SRC-Addr on N2K-Bus + // NMEA2000.EnableForward(false); // Disable all msg forwarding to USB (=Serial) NMEA2000.SetMsgHandler(HandleNMEA2000Msg); NMEA2000.Open(); @@ -300,6 +310,12 @@ Stream *OutputStream; lcd.print(F(PROG_NAME)); // print first line to lcd display lcd.setCursor(0,1); lcd.print(F(PROG_VER)); // print second line to lcd display + if (_LCDML_DISP_rows == 4) { + lcd.setCursor(0, 2); + lcd.print(line); // print third line to lcd display + lcd.setCursor(0, 3); + lcd.print(line); // print fourth line to lcd display + } delay(SHOW_NAME_VER*1000); diff --git a/NMEAmonitor.vcxproj b/NMEAmonitor.vcxproj index 71234ac..d256b58 100644 --- a/NMEAmonitor.vcxproj +++ b/NMEAmonitor.vcxproj @@ -47,10 +47,10 @@ Level3 Disabled true - $(ProjectDir)..\NMEAmonitor;$(ProjectDir)..\libraries\LCDMenuLib\src;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\LiquidCrystal;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\EEPROM;$(ProjectDir)..\libraries\NMEA2000\src;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FlexCAN;$(ProjectDir)..\libraries\NMEA2000_teensy;$(ProjectDir)..\libraries\NMEA0183;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Time;$(ProjectDir)..\libraries\DHT-sensor-library;$(ProjectDir)..\libraries\BMP180_Breakout_Arduino_Library\src;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire;$(ProjectDir)..\libraries\Adafruit_Sensor;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Keypad;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Keypad\utility;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire\utility;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\libraries;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries;$(ProjectDir)..\libraries;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\avr;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\util;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\utils;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\avr;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\arm\arm-none-eabi\include;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy;%(AdditionalIncludeDirectories) + $(ProjectDir)..\NMEAmonitor;$(ProjectDir)..\libraries\LCDMenuLib\src;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\LiquidCrystal\src;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\EEPROM;$(ProjectDir)..\libraries\NMEA2000\src;$(ProjectDir)..\libraries\NMEA2000_teensy;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\FlexCAN;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Keypad\src;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire\utility;$(ProjectDir)..\libraries\DHT-sensor-library;$(ProjectDir)..\libraries\BMP180_Breakout_Arduino_Library\src;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\libraries;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries;$(ProjectDir)..\libraries;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\avr;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\util;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\arm\arm-none-eabi\include;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\arm\lib\gcc\arm-none-eabi\5.4.1\include;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy;%(AdditionalIncludeDirectories) $(ProjectDir)__vm\.NMEAmonitor.vsarduino.h;%(ForcedIncludeFiles) false - __HARDWARE_MK20dx256__;__HARDWARE_MK20DX256__;_VMDEBUG=1;__MK20DX256__;TEENSYDUINO=134;ARDUINO=10801;F_CPU=96000000;USB_SERIAL;LAYOUT_GERMAN;__cplusplus=201103L;_VMICRO_INTELLISENSE;%(PreprocessorDefinitions) + __HARDWARE_MK20dx256__;__HARDWARE_MK20DX256__;__MK20DX256__;TEENSYDUINO=141;ARDUINO=10805;F_CPU=96000000;USB_SERIAL;LAYOUT_GERMAN;__cplusplus=201103L;_VMICRO_INTELLISENSE;%(PreprocessorDefinitions) true @@ -63,10 +63,10 @@ true true true - $(ProjectDir)..\NMEAmonitor;$(ProjectDir)..\libraries\LCDMenuLib\src;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\LiquidCrystal\src;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\EEPROM;$(ProjectDir)..\libraries\NMEA2000\src;$(ProjectDir)..\libraries\FlexCAN_Library;$(ProjectDir)..\libraries\NMEA2000_teensy;$(ProjectDir)..\libraries\DHT-sensor-library;$(ProjectDir)..\libraries\BMP180_Breakout_Arduino_Library\src;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire;$(ProjectDir)..\libraries\Adafruit_Sensor;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire\utility;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\libraries;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries;$(ProjectDir)..\libraries;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\avr;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\util;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\arm\arm-none-eabi\include;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\arm\lib\gcc\arm-none-eabi\5.4.1\include;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy;%(AdditionalIncludeDirectories) + $(ProjectDir)..\NMEAmonitor;$(ProjectDir)..\libraries\LCDMenuLib\src;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\LiquidCrystal\src;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\EEPROM;$(ProjectDir)..\libraries\NMEA2000\src;$(ProjectDir)..\libraries\FlexCAN_Library;$(ProjectDir)..\libraries\NMEA2000_teensy;$(ProjectDir)..\libraries\DHT-sensor-library;$(ProjectDir)..\libraries\BMP180_Breakout_Arduino_Library\src;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire;$(ProjectDir)..\libraries\Adafruit_Sensor;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Keypad\src;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire\utility;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\libraries;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\libraries;$(ProjectDir)..\libraries;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\avr;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy3\util;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\arm\arm-none-eabi\include;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\tools\arm\lib\gcc\arm-none-eabi\5.4.1\include;$(ProjectDir)..\..\..\..\..\Program Files (x86)\Arduino\hardware\teensy;%(AdditionalIncludeDirectories) $(ProjectDir)__vm\.NMEAmonitor.vsarduino.h;%(ForcedIncludeFiles) false - __HARDWARE_MK20dx256__;__HARDWARE_MK20DX256__;__MK20DX256__;TEENSYDUINO=141;ARDUINO=10805;F_CPU=96000000;USB_SERIAL;LAYOUT_US_ENGLISH;__cplusplus=201103L;_VMICRO_INTELLISENSE;%(PreprocessorDefinitions) + __HARDWARE_MK20dx256__;__HARDWARE_MK20DX256__;__MK20DX256__;TEENSYDUINO=144;ARDUINO=10807;F_CPU=96000000;USB_SERIAL;LAYOUT_GERMAN;__cplusplus=201103L;_VMICRO_INTELLISENSE;%(PreprocessorDefinitions) true @@ -81,12 +81,15 @@ + - + - + + + @@ -132,14 +135,20 @@ + + + + + + @@ -175,29 +184,42 @@ - - - - + + + - + + - - - + + + + + - - - - + + + + + + + + + + + + + + + @@ -205,6 +227,7 @@ + @@ -225,33 +248,49 @@ - - - + + + + - - + + + - - - + + + + + + + + + + + + - - + + + + + + + VisualMicroDebugger @@ -261,7 +300,7 @@ - + \ No newline at end of file diff --git a/NMEAmonitor.vcxproj.filters b/NMEAmonitor.vcxproj.filters index 64c6370..dae46b6 100644 --- a/NMEAmonitor.vcxproj.filters +++ b/NMEAmonitor.vcxproj.filters @@ -14,96 +14,85 @@ rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - {e958cfe1-ac86-4438-a3e4-2fbad375d4ff} + {6f2a295e-14fc-403d-8004-2fdafd195ea9} - {34ac1fb0-e978-48cb-9003-5d073356acf2} + {d41d4e7a-72c3-41e5-be6c-3c95ae9e873e} - {d200053f-3fc0-44f1-9c94-1c9b4d5abca3} + {0ad1110a-ea8f-4266-beaf-3edc04e754bf} - {cbf390ed-9de2-4435-8ef2-af9c3a1903a4} + {eb21ce2d-abcc-4345-a7c1-29e0fcce08fb} - {a4e46643-618b-44fd-8c6b-a9ca614915a9} + {03f357f0-38c6-4f3b-9a4d-6636c7ba8484} - {e9f127f8-9057-4bc5-8d3b-63d097649418} + {30c66993-944a-42c4-b7ad-8c198497349a} - - {2a1e5708-2ef2-4569-ac9e-73a3bb8086aa} + + {63109b07-cde9-47c3-a299-e0e3305cf28b} - - {f7092f61-1314-43bf-ae1c-101b256b9f85} - - - {b1781e95-df0e-4410-beb5-767a12be6f42} - - - {0de89c83-9c36-41ab-bb1c-dbbb576d827c} + + {1cf17812-883b-4342-bb25-9d2d95743cb0} - {300d5aaf-c391-48b8-b8f1-6268d5750db1} - - - {255b0c39-1643-4411-8b33-0d1c82edeea7} + {127201b1-88d7-43cb-b8c0-d0149bb8c2d2} - - {833480ed-feba-4762-8e41-81c6d7f69a35} - - - {7a6333b0-7fce-448c-8b35-0db8c526641a} + + {9dca2a26-88cd-49e8-8626-bab187a91f46} - - {1bbf51d3-aae4-4f02-9ef3-0b40a1ea8ade} + + {5af4fd81-f3c9-4f3d-a599-27a12c400f29} - - {775f9372-fdf9-4355-b8b3-5818ff6d806c} + + {889d1ea6-eefc-4692-8ffc-359d8624e2a9} - - {34e29fee-dcad-4528-bbb5-794bb047e14c} + + {45efb6c6-1140-40f2-b132-d2799ebc23fc} - - {0481a012-15ed-45a3-b704-e3505fcca020} + + {9466d75e-118d-48d8-804a-b73629b9768a} - - {8cfdd4dd-c03f-4657-8831-d7e68dd0cb7e} + + {03b2a3fa-0038-4485-815a-1c48b6a229e2} - - {79983363-230e-42ad-a7e0-fc698dd686ec} + + {4639b8a6-7358-4ece-b3f6-7032ec6c6a03} - - {84b4ebb9-8a12-46a0-9b39-08f6a8f5763d} + + {dbfb007a-e6b7-413f-af8d-41eb4731493d} - - {e9df34de-f63e-4836-b743-db6e6f893e55} + + {927b8da2-0ab9-4824-b3ea-ffb196420144} + + + + + + + src\_micro-api-readonly\core src\_micro-api-readonly\core - - src\_micro-api-readonly\libraries\Adafruit_Sensor-master - - - src\_micro-api-readonly\libraries\BMP180_Breakout_Arduino_Library + + src\_micro-api-readonly\libraries\LCDMenuLib - - src\_micro-api-readonly\libraries\DHT-sensor-library + + src\_micro-api-readonly\libraries\LiquidCrystal src\_micro-api-readonly\libraries\EEPROM - - src\_micro-api-readonly\libraries\LCDMenu - - - src\_micro-api-readonly\libraries\LiquidCrystal + + src\_micro-api-readonly\libraries\NMEA2000 src\_micro-api-readonly\libraries\NMEA2000 @@ -111,16 +100,24 @@ src\_micro-api-readonly\libraries\NMEA2000_teensy + + src\_micro-api-readonly\libraries\Keypad + src\_micro-api-readonly\libraries\Wire - - - - - - - + + src\_micro-api-readonly\libraries\DHT-sensor-library + + + src\_micro-api-readonly\libraries\DHT-sensor-library + + + src\_micro-api-readonly\libraries\BMP180_Breakout_Arduino_Library + + + src\_micro-api-readonly\libraries\Adafruit_Sensor + @@ -171,6 +168,12 @@ src\_micro-api-readonly\core + + src\_micro-api-readonly\core + + + src\_micro-api-readonly\core + src\_micro-api-readonly\core @@ -180,6 +183,9 @@ src\_micro-api-readonly\core + + src\_micro-api-readonly\core + src\_micro-api-readonly\core @@ -189,12 +195,21 @@ src\_micro-api-readonly\core + + src\_micro-api-readonly\core + src\_micro-api-readonly\core + + src\_micro-api-readonly\core + src\_micro-api-readonly\core + + src\_micro-api-readonly\core + src\_micro-api-readonly\core @@ -318,81 +333,120 @@ src\_micro-api-readonly\core\util - - src\_micro-api-readonly\libraries\Adafruit_Sensor-master + + src\_micro-api-readonly\libraries\LCDMenuLib - - src\_micro-api-readonly\libraries\BMP180_Breakout_Arduino_Library\src + + src\_micro-api-readonly\libraries\LCDMenuLib - - src\_micro-api-readonly\libraries\DHT-sensor-library + + src\_micro-api-readonly\libraries\LCDMenuLib - - src\_micro-api-readonly\libraries\DHT-sensor-library + + src\_micro-api-readonly\libraries\LiquidCrystal + + + src\_micro-api-readonly\libraries\LiquidCrystal src\_micro-api-readonly\libraries\EEPROM - - src\_micro-api-readonly\libraries\FlexCAN + + src\_micro-api-readonly\libraries\NMEA2000 - - src\_micro-api-readonly\libraries\FlexCAN + + src\_micro-api-readonly\libraries\NMEA2000 - - src\_micro-api-readonly\libraries\Keypad + + src\_micro-api-readonly\libraries\NMEA2000 - - src\_micro-api-readonly\libraries\Keypad\utility + + src\_micro-api-readonly\libraries\NMEA2000 - - src\_micro-api-readonly\libraries\LCDMenu\src + + src\_micro-api-readonly\libraries\NMEA2000 - - src\_micro-api-readonly\libraries\LCDMenu\src + + src\_micro-api-readonly\libraries\NMEA2000 - - src\_micro-api-readonly\libraries\LCDMenu\src + + src\_micro-api-readonly\libraries\NMEA2000 - - src\_micro-api-readonly\libraries\LiquidCrystal + + src\_micro-api-readonly\libraries\NMEA2000 - + src\_micro-api-readonly\libraries\NMEA2000 - + src\_micro-api-readonly\libraries\NMEA2000 - + src\_micro-api-readonly\libraries\NMEA2000 - + src\_micro-api-readonly\libraries\NMEA2000 - + src\_micro-api-readonly\libraries\NMEA2000 - + src\_micro-api-readonly\libraries\NMEA2000 - + src\_micro-api-readonly\libraries\NMEA2000 - + + src\_micro-api-readonly\libraries\NMEA2000 + + + src\_micro-api-readonly\libraries\NMEA2000 + + + src\_micro-api-readonly\libraries\NMEA2000 + + src\_micro-api-readonly\libraries\NMEA2000 - + src\_micro-api-readonly\libraries\NMEA2000 src\_micro-api-readonly\libraries\NMEA2000_teensy + + src\_micro-api-readonly\libraries\Keypad + + + src\_micro-api-readonly\libraries\Keypad + src\_micro-api-readonly\libraries\Wire + + src\_micro-api-readonly\libraries\Wire + src\_micro-api-readonly\libraries\Wire\utility + + src\_micro-api-readonly\libraries\FlexCAN_Library + + + src\_micro-api-readonly\libraries\FlexCAN_Library + + + src\_micro-api-readonly\libraries\DHT-sensor-library + + + src\_micro-api-readonly\libraries\DHT-sensor-library + + + src\_micro-api-readonly\libraries\BMP180_Breakout_Arduino_Library + + + src\_micro-api-readonly\libraries\Adafruit_Sensor + @@ -404,6 +458,9 @@ src\_micro-api-readonly\core + + src\_micro-api-readonly\core + src\_micro-api-readonly\core @@ -461,85 +518,133 @@ src\_micro-api-readonly\core - - src\_micro-api-readonly\libraries\BMP180_Breakout_Arduino_Library\src + + src\_micro-api-readonly\libraries\LCDMenuLib - - src\_micro-api-readonly\libraries\DHT-sensor-library + + src\_micro-api-readonly\libraries\LCDMenuLib - - src\_micro-api-readonly\libraries\DHT-sensor-library + + src\_micro-api-readonly\libraries\LiquidCrystal + + + src\_micro-api-readonly\libraries\LiquidCrystal src\_micro-api-readonly\libraries\EEPROM - - src\_micro-api-readonly\libraries\FlexCAN + + src\_micro-api-readonly\libraries\NMEA2000 - - src\_micro-api-readonly\libraries\Keypad + + src\_micro-api-readonly\libraries\NMEA2000 - - src\_micro-api-readonly\libraries\Keypad\utility + + src\_micro-api-readonly\libraries\NMEA2000 - - src\_micro-api-readonly\libraries\LCDMenu\src + + src\_micro-api-readonly\libraries\NMEA2000 - - src\_micro-api-readonly\libraries\LCDMenu\src + + src\_micro-api-readonly\libraries\NMEA2000 - - src\_micro-api-readonly\libraries\LiquidCrystal + + src\_micro-api-readonly\libraries\NMEA2000 - + src\_micro-api-readonly\libraries\NMEA2000 - + src\_micro-api-readonly\libraries\NMEA2000 - + src\_micro-api-readonly\libraries\NMEA2000 - + src\_micro-api-readonly\libraries\NMEA2000 - + + src\_micro-api-readonly\libraries\NMEA2000 + + + src\_micro-api-readonly\libraries\NMEA2000 + + + src\_micro-api-readonly\libraries\NMEA2000 + + src\_micro-api-readonly\libraries\NMEA2000 src\_micro-api-readonly\libraries\NMEA2000_teensy + + src\_micro-api-readonly\libraries\Keypad + + + src\_micro-api-readonly\libraries\Keypad + src\_micro-api-readonly\libraries\Wire + + src\_micro-api-readonly\libraries\Wire + src\_micro-api-readonly\libraries\Wire\utility + + src\_micro-api-readonly\libraries\FlexCAN_Library + + + src\_micro-api-readonly\libraries\DHT-sensor-library + + + src\_micro-api-readonly\libraries\DHT-sensor-library + + + src\_micro-api-readonly\libraries\BMP180_Breakout_Arduino_Library + - - src\_micro-api-readonly\libraries\BMP180_Breakout_Arduino_Library + + src\_micro-api-readonly\libraries\LCDMenuLib - - src\_micro-api-readonly\libraries\DHT-sensor-library + + src\_micro-api-readonly\libraries\LiquidCrystal src\_micro-api-readonly\libraries\EEPROM - - src\_micro-api-readonly\libraries\FlexCAN + + src\_micro-api-readonly\libraries\NMEA2000 - - src\_micro-api-readonly\libraries\Keypad + + src\_micro-api-readonly\libraries\NMEA2000 - - src\_micro-api-readonly\libraries\LCDMenu + + src\_micro-api-readonly\libraries\NMEA2000 - - src\_micro-api-readonly\libraries\LiquidCrystal + + src\_micro-api-readonly\libraries\NMEA2000 + + + src\_micro-api-readonly\libraries\NMEA2000 + + + src\_micro-api-readonly\libraries\Keypad src\_micro-api-readonly\libraries\Wire + + src\_micro-api-readonly\libraries\FlexCAN_Library + + + src\_micro-api-readonly\libraries\DHT-sensor-library + + + src\_micro-api-readonly\libraries\BMP180_Breakout_Arduino_Library + \ No newline at end of file diff --git a/monFuncDisp.ino b/monFuncDisp.ino index 8fcaab4..b98a3c0 100644 --- a/monFuncDisp.ino +++ b/monFuncDisp.ino @@ -359,21 +359,21 @@ static unsigned long ledBuiltinOnOff=0; } } -void DisplayPosition(char* lat, char* lon); -void DisplayTimeDate(char* time, char* date); -void DisplaySogCog(char* SOG, char* COG); -void DisplayStwHeading(char* stw, char* heading); -void DisplayBftGwd(char* bft, char* gwd); -void DisplayTwsTwa(char* tws, char* twa); -void DisplayAwsAwa(char* aws, char* awa); -void DisplayWaterDepth(char* waterTemp, char* depth); -void DisplayAirPress(char* airTemp, char* press); -void DisplayLogTrip(char* log, char* trip); -void DisplayBatt(char* batt1, char* batt2); -void DisplayEngine(char* rpmPort, char* rpmStbd); -void DisplayPressHum(char* pressure, char* humidity); +void DisplayPosition(char* lat, char* lon, int row); +void DisplayTimeDate(char* time, char* date, int row); +void DisplaySogCog(char* SOG, char* COG, int row); +void DisplayStwHeading(char* stw, char* heading, int row); +void DisplayBftGwd(char* bft, char* gwd, int row); +void DisplayTwsTwa(char* tws, char* twa, int row); +void DisplayAwsAwa(char* aws, char* awa, int row); +void DisplayWaterDepth(char* waterTemp, char* depth, int row); +void DisplayAirPress(char* airTemp, char* press, int row); +void DisplayLogTrip(char* log, char* trip, int row); +void DisplayBatt(char* batt1, char* batt2, int row); +void DisplayEngine(char* rpmPort, char* rpmStbd, int row); +void DisplayPressHum(char* pressure, char* humidity, int row); -static void (*p[PAGECOUNT]) (char*, char*) {DisplayPressHum, DisplayPosition, DisplayTimeDate, DisplaySogCog, DisplayStwHeading, +static void (*p[PAGECOUNT]) (char*, char*, int) {DisplayPressHum, DisplayPosition, DisplayTimeDate, DisplaySogCog, DisplayStwHeading, DisplayBftGwd, DisplayTwsTwa, DisplayAwsAwa, DisplayWaterDepth, DisplayAirPress, DisplayLogTrip, DisplayBatt, DisplayEngine}; @@ -425,7 +425,7 @@ static int suppressCount; } if (flag[pagedisplayed] == 1){ - (*p[pagedisplayed]) ((char *)"",(char *)""); // call the page display function + (*p[pagedisplayed]) ((char *)"",(char *)"", 0); // call the page display function } else { suppressCount=PAGECOUNT; @@ -440,7 +440,7 @@ static int suppressCount; DisplaySuppressed(); } else { - (*p[pagedisplayed]) ((char *)"", (char *)""); // call the page display function + (*p[pagedisplayed]) ((char *)"", (char *)"", 0); // call the page display function } } diff --git a/pages.ino b/pages.ino index 6b7eda5..7f98d3f 100644 --- a/pages.ino +++ b/pages.ino @@ -2,175 +2,214 @@ // 54°22.300'N // 018°56.467'E // Position Vessel’s position. -void DisplayPosition(char* lat, char* lon) { - lcd.setCursor(0, 0); // set the cursor to column 0, line 0 (line 0 is the first line) +void DisplayPosition(char* lat, char* lon, int row) { + lcd.setCursor(0, row); // set the cursor to column 0, line 0 (line 0 is the first line) sprintf(line, "lat %2.0f%c%6.3f'N", LAT_DEG_disp, (char)0xDF, LAT_MIN_disp); lcd.print(line); - lcd.setCursor(0, 1); // set the cursor to column 0, line 1 (line 1 is the second line) + lcd.setCursor(0, row+1); // set the cursor to column 0, line 1 (line 1 is the second line) sprintf(line, "lon %03.0f%c%6.3f'E", LONG_DEG_disp, (char)0xDF, LONG_MIN_disp); lcd.print(line); + if ((row == 0) && (_LCDML_DISP_rows == 4)) { + DisplayTimeDate((char *)"", (char *)"", 2); + } } // page 2 // Date 10.10.2015 // (UTC) 09:45:56 // Date & Time System date and time, format may be changed in the settings. -void DisplayTimeDate(char* time, char* date) { - lcd.setCursor(0, 0); // set the cursor to column 0, line 0 (line 0 is the first line) +void DisplayTimeDate(char* time, char* date, int row) { + lcd.setCursor(0, row); // set the cursor to column 0, line 0 (line 0 is the first line) sprintf(line, "Date %02d.%02d.%04d", DatumZeit_disp.day, DatumZeit_disp.month, DatumZeit_disp.year); lcd.print(line); - lcd.setCursor(0, 1); // set the cursor to column 0, line 1 (line 1 is the second line) + lcd.setCursor(0, row+1); // set the cursor to column 0, line 1 (line 1 is the second line) sprintf(line, "(UTC) %02d:%02d:%02d", DatumZeit_disp.hour, DatumZeit_disp.minute, DatumZeit_disp.second); lcd.print(line); + if ((row == 0) && (_LCDML_DISP_rows == 4)) { + DisplaySogCog((char *)"", (char *)"", 2); + } } // page 3 // SOG 5.6kn // COG 112.3°T // COG and SOG Course Over Ground and Speed Over Ground. -void DisplaySogCog(char* SOG, char* COG) { - lcd.setCursor(0, 0); // set the cursor to column 0, line 0 (line 0 is the first line) +void DisplaySogCog(char* SOG, char* COG, int row) { + lcd.setCursor(0, row); // set the cursor to column 0, line 0 (line 0 is the first line) sprintf(line, "SOG %4.1fkn", SOG_disp); lcd.print(line); - lcd.setCursor(0, 1); // set the cursor to column 0, line 1 (line 1 is the second line) + lcd.setCursor(0, row+1); // set the cursor to column 0, line 1 (line 1 is the second line) sprintf(line, "COG %5.1f%cT", COG_disp, (char)0xDF); lcd.print(line); + if ((row == 0) && (_LCDML_DISP_rows == 4)) { + DisplayStwHeading((char *)"", (char *)"", 2); + } } // page 4 // STW 4.8kn // HDG 102.5°T // STW/Heading Speed Through Water and Heading. -void DisplayStwHeading(char* stw, char* heading) { - lcd.setCursor(0, 0); // set the cursor to column 0, line 0 (line 0 is the first line) +void DisplayStwHeading(char* stw, char* heading, int row) { + lcd.setCursor(0, row); // set the cursor to column 0, line 0 (line 0 is the first line) sprintf(line, "STW %4.1fkn", STW_disp); //sprintf(line, " "); lcd.print(line); - lcd.setCursor(0, 1); // set the cursor to column 0, line 1 (line 1 is the second line) + lcd.setCursor(0, row+1); // set the cursor to column 0, line 1 (line 1 is the second line) sprintf(line, "HDG %5.1f%cT", HDG_disp, (char)0xDF ); lcd.print(line); + if ((row == 0) && (_LCDML_DISP_rows == 4)) { + DisplayBftGwd((char *)"", (char *)"", 2); + } } // page 5 // Bft 3 NW // GWD 204.3° // TWS and TWA True Wind Speed and True Wind Angle. -void DisplayBftGwd(char* bft, char* gwd) { - lcd.setCursor(0, 0); // set the cursor to column 0, line 0 (line 0 is the first line) +void DisplayBftGwd(char* bft, char* gwd, int row) { + lcd.setCursor(0, row); // set the cursor to column 0, line 0 (line 0 is the first line) sprintf(line, "Bft %2.0f %s", Bft_disp, GwdRose_disp); //sprintf(line, " "); lcd.print(line); - lcd.setCursor(0, 1); // set the cursor to column 0, line 1 (line 1 is the second line) + lcd.setCursor(0, row+1); // set the cursor to column 0, line 1 (line 1 is the second line) sprintf(line, "GWD %5.1f%cT", Gwd_disp, (char)0xDF); lcd.print(line); + if ((row == 0) && (_LCDML_DISP_rows == 4)) { + DisplayTwsTwa((char *)"", (char *)"", 2); + } } // page 6 // TWS 6.8kn // TWA 204.3°T // TWS and TWA True Wind Speed and True Wind Angle. -void DisplayTwsTwa(char* tws, char* twa) { - lcd.setCursor(0, 0); // set the cursor to column 0, line 0 (line 0 is the first line) +void DisplayTwsTwa(char* tws, char* twa, int row) { + lcd.setCursor(0, row); // set the cursor to column 0, line 0 (line 0 is the first line) sprintf(line, "TWS %4.1fkn", TWS_disp); //sprintf(line, " "); lcd.print(line); - lcd.setCursor(0, 1); // set the cursor to column 0, line 1 (line 1 is the second line) + lcd.setCursor(0, row+1); // set the cursor to column 0, line 1 (line 1 is the second line) sprintf(line, "TWD %5.1f%cT", TWD_disp, (char)0xDF); lcd.print(line); + if ((row == 0) && (_LCDML_DISP_rows == 4)) { + DisplayAwsAwa((char *)"", (char *)"", 2); + } } // page 7 // AWS 7.1kn // AWA 61.0°T // AWS and AWA Apparent Wind Speed and Apparent Wind Angle. -void DisplayAwsAwa(char* aws, char* awa) { - lcd.setCursor(0, 0); // set the cursor to column 0, line 0 (line 0 is the first line) +void DisplayAwsAwa(char* aws, char* awa, int row) { + lcd.setCursor(0, row); // set the cursor to column 0, line 0 (line 0 is the first line) sprintf(line, "AWS %4.1fkn", AWS_disp); //sprintf(line, " "); lcd.print(line); - lcd.setCursor(0, 1); // set the cursor to column 0, line 1 (line 1 is the second line) + lcd.setCursor(0, row+1); // set the cursor to column 0, line 1 (line 1 is the second line) sprintf(line, "AWA %5.1f%cT", AWA_disp, (char)0xDF); lcd.print(line); + if ((row == 0) && (_LCDML_DISP_rows == 4)) { + DisplayWaterDepth((char *)"", (char *)"", 2); + } } // page 8 // WATER 18.5°C // DEPTH 3.2 m // Water page Water temperature and depth. -void DisplayWaterDepth(char* waterTemp, char* depth) { - lcd.setCursor(0, 0); // set the cursor to column 0, line 0 (line 0 is the first line) +void DisplayWaterDepth(char* waterTemp, char* depth, int row) { + lcd.setCursor(0, row); // set the cursor to column 0, line 0 (line 0 is the first line) sprintf(line, "WaterTemp %4.1f%cC", TempWater_disp, (char)0xDF); //sprintf(line, " "); lcd.print(line); - lcd.setCursor(0, 1); // set the cursor to column 0, line 1 (line 1 is the second line) + lcd.setCursor(0, row+1); // set the cursor to column 0, line 1 (line 1 is the second line) sprintf(line, "Depth %4.1f m", Depth_disp); lcd.print(line); + if ((row == 0) && (_LCDML_DISP_rows == 4)) { + DisplayAirPress((char *)"", (char *)"", 2); + } } // page 9 // AIR TEMP 17.1°C // ATM PRS 1019.4mb // Air page Air temperature and atmospheric pressure. -void DisplayAirPress(char* airTemp, char* press) { - lcd.setCursor(0, 0); // set the cursor to column 0, line 0 (line 0 is the first line) +void DisplayAirPress(char* airTemp, char* press, int row) { + lcd.setCursor(0, row); // set the cursor to column 0, line 0 (line 0 is the first line) sprintf(line, "AirTemp %4.1f%cC", TempAirHum_disp, (char)0xDF); //sprintf(line, " "); lcd.print(line); - lcd.setCursor(0, 1); // set the cursor to column 0, line 1 (line 1 is the second line) + lcd.setCursor(0, row+1); // set the cursor to column 0, line 1 (line 1 is the second line) sprintf(line, "AtmPress%4.0fmBar", Press_disp); lcd.print(line); + if ((row == 0) && (_LCDML_DISP_rows == 4)) { + DisplayLogTrip((char *)"", (char *)"", 2); + } } // page 10 // LOG 1453.54nm // TRIP 275.81nm // Log & trip Log and trip distance. -void DisplayLogTrip(char* log, char* trip) { - lcd.setCursor(0, 0); // set the cursor to column 0, line 0 (line 0 is the first line) +void DisplayLogTrip(char* log, char* trip, int row) { + lcd.setCursor(0, row); // set the cursor to column 0, line 0 (line 0 is the first line) sprintf(line, "LOG %9.2fnm", LOG_disp); //sprintf(line, " "); lcd.print(line); - lcd.setCursor(0, 1); // set the cursor to column 0, line 1 (line 1 is the second line) + lcd.setCursor(0, row+1); // set the cursor to column 0, line 1 (line 1 is the second line) sprintf(line, "TRIP %7.2fnm", TRIP_disp); lcd.print(line); + if ((row == 0) && (_LCDML_DISP_rows == 4)) { + DisplayBatt((char *)"", (char *)"", 2); + } } // page 11 // BATTERY1 13.8V // BATTERY2 ---.-V // Battery Battery’s voltage. -void DisplayBatt(char* batt1, char* batt2) { - lcd.setCursor(0, 0); // set the cursor to column 0, line 0 (line 0 is the first line) +void DisplayBatt(char* batt1, char* batt2, int row) { + lcd.setCursor(0, row); // set the cursor to column 0, line 0 (line 0 is the first line) sprintf(line, "BATT-1 13.8V"); //sprintf(line, " "); lcd.print(line); - lcd.setCursor(0, 1); // set the cursor to column 0, line 1 (line 1 is the second line) + lcd.setCursor(0, row+1); // set the cursor to column 0, line 1 (line 1 is the second line) sprintf(line, "BATT-2 --.-V"); lcd.print(line); + if ((row == 0) && (_LCDML_DISP_rows == 4)) { + DisplayEngine((char *)"", (char *)"", 2); + } } // page 12 // ENGINE PORT/STBD // 1255 ----- rpm // Engines Port and starboard engines revolutions. -void DisplayEngine(char* rpmPort, char* rpmStbd) { - lcd.setCursor(0, 0); // set the cursor to column 0, line 0 (line 0 is the first line) +void DisplayEngine(char* rpmPort, char* rpmStbd, int row) { + lcd.setCursor(0, row); // set the cursor to column 0, line 0 (line 0 is the first line) sprintf(line, "ENGINE PORT/STBD"); lcd.print(line); - lcd.setCursor(0, 1); // set the cursor to column 0, line 1 (line 1 is the second line) + lcd.setCursor(0, row+1); // set the cursor to column 0, line 1 (line 1 is the second line) sprintf(line, " 1255/---- rpm"); lcd.print(line); + if ((row == 0) && (_LCDML_DISP_rows == 4)) { + DisplayPressHum((char *)"", (char *)"", 2); + } } // page 13 // Pressure/Humidity -void DisplayPressHum(char* pressure, char* humidity) { - lcd.setCursor(0, 0); // set the cursor to column 0, line 0 (line 0 is the first line) +void DisplayPressHum(char* pressure, char* humidity, int row) { + lcd.setCursor(0, row); // set the cursor to column 0, line 0 (line 0 is the first line) sprintf(line, "P= %4.0f,T=%2.1f%cC", Press_disp, TempAirPress_disp, (char)0xDF); lcd.print(line); - lcd.setCursor(0, 1); // set the cursor to column 0, line 1 (line 1 is the second line) + lcd.setCursor(0, row+1); // set the cursor to column 0, line 1 (line 1 is the second line) sprintf(line, "F= %2.0f%%,T=%2.1f%cC", Hum_disp, TempAirHum_disp, (char)0xDF); lcd.print(line); + if ((row == 0) && (_LCDML_DISP_rows == 4)) { + DisplayPosition((char *)"", (char *)"", 2); + } } // page 14 @@ -184,6 +223,12 @@ void DisplaySuppressed() { lcd.setCursor(0, 1); // set the cursor to column 0, line 1 (line 1 is the second line) sprintf(line, "suppressed! "); lcd.print(line); + if (_LCDML_DISP_rows == 4) { + lcd.setCursor(0, 2); + lcd.print(" "); // print third line to lcd display + lcd.setCursor(0, 3); + lcd.print(" "); // print fourth line to lcd display + } }