Skip to content

Commit

Permalink
added NMEA configuration screen
Browse files Browse the repository at this point in the history
  • Loading branch information
barry-ha committed Feb 12, 2024
1 parent 3cd6e4f commit 857cebd
Show file tree
Hide file tree
Showing 9 changed files with 388 additions and 133 deletions.
13 changes: 11 additions & 2 deletions Griduino.ino
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
#include "cfg_audio_type.h" // config audio Morse/speech
#include "cfg_crossing.h" // config 4/6 digit crossing
#include "cfg_gps.h" // config GPS (alphabetical order)
#include "cfg_nmea.h" // config NMEA broadcasting
#include "cfg_reboot.h" // show firmware update option
#include "cfg_rotation.h" // config screen rotation
#include "cfg_units.h" // config english/metric
Expand Down Expand Up @@ -169,6 +170,7 @@ Adafruit_GPS GPS(&Serial1); // https://github.com/adafruit/Adafruit_GP
// ---------- config settings
// these are controllable by serial USB commands (command.h)
bool showTouchTargets = false;
bool showCenterline = false;

// ---------- lat/long and date/time conversion utilities
Grids grid = Grids();
Expand Down Expand Up @@ -329,6 +331,7 @@ enum VIEW_INDEX {
CFG_AUDIO_TYPE, // audio output Morse/speech
CFG_CROSSING, // announce grid crossing 4/6 digit boundaries
CFG_GPS, // gps/simulator
CFG_NMEA, // broadcast NMEA
CFG_REBOOT, // confirm reboot
CFG_ROTATION, // screen rotation
CFG_UNITS, // english/metric
Expand Down Expand Up @@ -366,6 +369,7 @@ ViewBaro baroView(&tft, BARO_VIEW); // instantiate derived c
ViewCfgAudioType cfgAudioType(&tft, CFG_AUDIO_TYPE);
ViewCfgCrossing cfgCrossing(&tft, CFG_CROSSING);
ViewCfgGPS cfgGPS(&tft, CFG_GPS);
ViewCfgNMEA cfgNMEA(&tft, CFG_NMEA);
ViewCfgReboot cfgReboot(&tft, CFG_REBOOT);
ViewCfgRotation cfgRotation(&tft, CFG_ROTATION);
ViewCfgUnits cfgUnits(&tft, CFG_UNITS);
Expand All @@ -392,6 +396,7 @@ void selectNewView(int cmd) {
&cfgAudioType, // [CFG_AUDIO_TYPE]
&cfgCrossing, // [CFG_CROSSING]
&cfgGPS, // [CFG_GPS]
&cfgNMEA, // [CFG_NMEA]
&cfgReboot, // [CFG_REBOOT]
&cfgRotation, // [CFG_ROTATION]
&cfgUnits, // [CFG_UNITS]
Expand Down Expand Up @@ -435,7 +440,8 @@ void selectNewView(int cmd) {
//se VOLUME2_VIEW: nextView = CFG_AUDIO_TYPE; break;
case CFG_AUDIO_TYPE: nextView = CFG_CROSSING; break;
case CFG_CROSSING: nextView = CFG_GPS; break;
case CFG_GPS: nextView = CFG_UNITS; break;
case CFG_GPS: nextView = CFG_NMEA; break;
case CFG_NMEA: nextView = CFG_UNITS; break;
case CFG_UNITS: nextView = CFG_ROTATION; break;
#if defined(ARDUINO_ADAFRUIT_FEATHER_RP2040)
case CFG_ROTATION: nextView = CFG_REBOOT; break;
Expand Down Expand Up @@ -643,7 +649,6 @@ void setup() {
tft.fillScreen(ILI9341_BLACK); // note that "begin()" does not clear screen

// ----- init screen orientation
Serial.println("Starting cfgRotation.loadConfig()...");
cfgRotation.loadConfig(); // restore previous screen orientation

// ----- init touchscreen
Expand All @@ -667,6 +672,10 @@ void setup() {
Serial.println("Compiled " PROGRAM_COMPILED); // Report our compiled date
Serial.println(__FILE__); // Report our source code file name

// ----- init NMEA broadcasting on/off
logger.info("Starting cfgNMEA.loadConfig()...");
cfgNMEA.loadConfig();

// ----- init GPS
GPS.begin(9600); // 9600 NMEA is the default baud rate for Adafruit MTK GPS's
delay(50); // is delay really needed?
Expand Down
24 changes: 12 additions & 12 deletions cfg_audio_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@
Since it's not intended for a driver in motion, we can use
a smaller font and cram more stuff onto the screen.
+-----------------------------------------+
| 2. Audio Type |
| |
| Announcements (o)[ Morse code ] |... yRow1
| |
| ( )[ Spoken word ] |... yRow2
| |
| ( )[ No audio ] |... yRow3
| |
| v1.11, Dec 13 2022 |... yRow9
+-----------------------------------------+
+-------------------------------------------+
| Audio Type |
| |
| Announcements (o)[ Morse code ] |... yRow1
| |
| ( )[ Spoken word ] |... yRow2
| |
| ( )[ No audio ] |... yRow3
| |
| v1.12, Feb 10 2021 |... yRow9
+-------------------------------------------+
*/

#include <Adafruit_ILI9341.h> // TFT color display library
Expand Down Expand Up @@ -204,7 +204,7 @@ void ViewCfgAudioType::startScreen() {
txtSettings5[ii].print();
}

showProgressBar(2, 6); // draw marker for advancing through settings
showProgressBar(2, 7); // draw marker for advancing through settings
showScreenBorder(); // optionally outline visible area
showScreenCenterline(); // optionally draw alignment bar

Expand Down
4 changes: 2 additions & 2 deletions cfg_crossing.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
a smaller font and cram more stuff onto the screen.
+-------------------------------------------+
| 3. Announcements |
| * 3. Announcements > |
| |
| Announce at (o)[ 4-digit ] |
| grid crossing: |
Expand Down Expand Up @@ -197,7 +197,7 @@ void ViewCfgCrossing::startScreen() {
txtSettings4[ii].print();
}

showProgressBar(3, 6); // draw marker for advancing through settings
showProgressBar(3, 7); // draw marker for advancing through settings
showScreenBorder(); // optionally outline visible area
showScreenCenterline(); // optionally draw alignment bar

Expand Down
26 changes: 13 additions & 13 deletions cfg_gps.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
Since it's not intended for a driver in motion, we can use
a smaller font and cram more stuff onto the screen.
+-----------------------------------------+
| 4. GPS |
| |
| Breadcrumb trail [ Clear ] |
| 123 of 6000 |
| |
| Route (o)[ GPS Receiver ] |
| ( )[ Simulator ] |
| |
| |
| v0.32, Feb 2 2021 08:16 |
+-----------------------------------------+
+-------------------------------------------+
| 4. GPS |
| |
| Breadcrumb trail [ Clear ] |
| 123 of 6000 |
| |
| Route (o)[ GPS Receiver ] |
| ( )[ Simulator ] |
| |
| |
| v1.12, Feb 10 2021 |... yRow9
+-------------------------------------------+
*/

#include <Adafruit_ILI9341.h> // TFT color display library
Expand Down Expand Up @@ -205,7 +205,7 @@ void ViewCfgGPS::startScreen() {
tft->drawCircle(xCenter, yCenter, 7, cVALUE);
}

showProgressBar(4, 6); // draw marker for advancing through settings
showProgressBar(4, 7); // draw marker for advancing through settings
updateScreen(); // fill in values immediately, don't wait for the main loop to eventually get around to it

showScreenCenterline(); // optionally draw alignment bar
Expand Down

0 comments on commit 857cebd

Please sign in to comment.