-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpages.ino
234 lines (219 loc) · 8.54 KB
/
pages.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
// page 1
// 54°22.300'N
// 018°56.467'E
// Position Vessel’s position.
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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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, 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
// All pages
// suppressed
void DisplaySuppressed() {
lcd.setCursor(0, 0); // set the cursor to column 0, line 0 (line 0 is the first line)
sprintf(line, "All pages ");
//sprintf(line, " ");
lcd.print(line);
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
}
}