{"id":5042,"date":"2026-11-25T09:03:21","date_gmt":"2026-11-25T17:03:21","guid":{"rendered":"https:\/\/www.donluc.com\/?p=5042"},"modified":"2026-11-25T09:03:21","modified_gmt":"2026-11-25T17:03:21","slug":"project-15-environment-gnss-mk54","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=5042","title":{"rendered":"Project #15: Environment \u2013 GNSS \u2013 Mk54"},"content":{"rendered":"<div style=\"width: 1200px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-5042-1\" width=\"1200\" height=\"675\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/11\/DL2610Mk06W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/11\/DL2610Mk06W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/11\/DL2610Mk06W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #GNSS #AHT20 #RTC #TextoSpeech #Environment #SD #FireBeetle2ESP32E #ESP32 #Display #IoT #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/11\/DL2610Mk06a.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/11\/DL2610Mk06a.jpg\" alt=\"GNSS\" width=\"780\" height=\"816\" class=\"alignnone size-full wp-image-5045\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/11\/DL2610Mk06a.jpg 780w, https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/11\/DL2610Mk06a-287x300.jpg 287w, https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/11\/DL2610Mk06a-768x803.jpg 768w\" sizes=\"auto, (max-width: 780px) 100vw, 780px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/11\/DL2610Mk06b.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/11\/DL2610Mk06b.jpg\" alt=\"GNSS\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-5046\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/11\/DL2610Mk06b.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/11\/DL2610Mk06b-300x200.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/11\/DL2610Mk06c.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/11\/DL2610Mk06c.jpg\" alt=\"GNSS\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-5047\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/11\/DL2610Mk06c.jpg 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2026\/11\/DL2610Mk06c-300x200.jpg 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>What Is GNSS?<\/strong><\/p>\n<p>GNSS stands for Global Navigation Satellite System. It is the general term used for satellite-based positioning systems that allow receivers on Earth to determine their location. Several GNSS constellations are currently operating around the world:<\/p>\n<p>GPS (United States)<br \/>\nGLONASS (Russia)<br \/>\nGalileo (European Union)<br \/>\nBeiDou (China)<\/p>\n<p>Modern GNSS receivers can communicate with multiple satellite systems simultaneously, improving accuracy and reducing the time required to obtain a position fix.<\/p>\n<p><strong>How Does GNSS Work?<\/strong><\/p>\n<p>Each GNSS satellite continuously broadcasts signals containing: Its precise position in space.  The exact transmission time.  System timing information. The GNSS receiver measures how long these signals take to reach it from multiple satellites. Since radio signals travel at the speed of light, the receiver can calculate its distance from each satellite. By combining measurements from at least four satellites, the receiver performs a process called trilateration to determine:<\/p>\n<p>Latitude<br \/>\nLongitude<br \/>\nAltitude<br \/>\nTime<\/p>\n<p><strong>DL2610Mk06<\/strong><\/p>\n<p>1 x DFRobot FireBeetle 2 ESP32-E<br \/>\n1 x Adafruit SSD1306<br \/>\n1 x Gravity: IO Shield for FireBeetle 2<br \/>\n1 x Gravity: I2C HUB<br \/>\n1 x Gravity: GNSS GPS BeiDou Receiver Module<br \/>\n1 x Gravity: I2C SD2405 RTC Module<br \/>\n1 x Gravity: AHT20 Temperature and Humidity Sensor<br \/>\n1 x Fermion: MicroSD Card Module<br \/>\n1 x MicroSD 8 GB<br \/>\n1 x Gravity: LED Switch Green<br \/>\n1 x Gravity: Text to Speech Voice Synthesizer Module<br \/>\n1 x Gravity: Digital Push Button (White)<br \/>\n1 x Gravity: Digital Blue LED Light Module<br \/>\n1 x Lithium Ion Battery &#8211; 1000mAh<br \/>\n1 x USB 3.0 to Type-C Cable<\/p>\n<p><strong>DL2610Mk06p<\/strong><\/p>\n<p><strong>DL2610Mk06p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/****** Don Luc Electronics \u00a9 ******\r\nSoftware Version Information\r\nProject #15: Environment \u2013 GNSS \u2013 Mk54\r\n15-54\r\nDL2610Mk06p.ino\r\nDL2610Mk06\r\n1 x DFRobot FireBeetle 2 ESP32-E\r\n1 x Adafruit SSD1306\r\n1 x Gravity: IO Shield for FireBeetle 2\r\n1 x Gravity: I2C HUB\r\n1 x Gravity: GNSS GPS BeiDou Receiver Module\r\n1 x Gravity: I2C SD2405 RTC Module\r\n1 x Gravity: AHT20 Temperature and Humidity Sensor\r\n1 x Fermion: MicroSD Card Module \r\n1 x MicroSD 8 GB\r\n1 x Gravity: LED Switch Green\r\n1 x Gravity: Text to Speech Voice Synthesizer Module\r\n1 x Gravity: Digital Push Button (White)\r\n1 x Gravity: Digital Blue LED Light Module\r\n1 x Lithium Ion Battery - 1000mAh\r\n1 x USB 3.0 to Type-C Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ Wire\r\n#include &lt;Wire.h&gt;\r\n\/\/ SD Card\r\n\/\/ File System\r\n#include &quot;FS.h&quot;\r\n\/\/ SD Card\r\n#include &quot;SD.h&quot;\r\n\/\/ SPI (Serial Peripheral Interface)\r\n#include &quot;SPI.h&quot;\r\n\/\/ Speech Synthesis\r\n#include &lt;DFRobot_SpeechSynthesis_V2.h&gt;\r\n\/\/ Adafruit SSD1306\r\n#include &lt;Adafruit_SSD1306.h&gt;\r\n\/\/ RTC (Real-Time Clock)\r\n#include &quot;GravityRtc.h&quot;\r\n\/\/ AHT20 Humidity and Temperature Sensor\r\n#include &lt;DFRobot_AHT20.h&gt;\r\n\/\/ GNSS GPS\r\n#include &lt;DFRobot_GNSS.h&gt;\r\n\r\n\/\/ Adafruit SSD1306\r\n#define SCREEN_WIDTH 128\r\n#define SCREEN_HEIGHT 64\r\n#define OLED_RESET -1\r\nAdafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &amp;Wire, OLED_RESET);\r\n\r\n\/\/ GNSS GPS\r\n\/\/ Use I2C for communication, but use the serial port for\r\n\/\/ communication if the line of codes were masked\r\n#define I2C_COMMUNICATION\r\n\/\/ ESP32 user hardware uart\r\nDFRobot_GNSS_I2C gnss(&amp;Wire, GNSS_DEVICE_ADDR);\r\nString sDate = &quot;&quot;;\r\nString sUTC = &quot;&quot;;\r\nString sLat = &quot;&quot;;\r\nString sLon = &quot;&quot;;\r\nString sAlt = &quot;&quot;;\r\n\r\n\/\/ AHT20 Humidity and Temperature Sensor\r\nDFRobot_AHT20 aht20;\r\n\/\/ AHT20 Humidity and Temperature Sensor\r\nfloat h = 0;\r\nfloat t = 0;\r\n\r\n\/\/ RTC Initialization\r\nGravityRtc rtc;\r\n\/\/ Date and Time\r\nString dateRTC = &quot;&quot;;\r\nString timeRTC = &quot;&quot;;\r\n\r\n\/\/ Speech Synthesis\r\nDFRobot_SpeechSynthesis_I2C ss;\r\n\r\n\/\/ Button\r\n\/\/ The number of the pushbutton pin\r\nconst int iButton = D10;\r\n\/\/ Variables will change:\r\nint iButtonState = 0;\r\n\r\n\/\/ Switch\r\n\/\/ The number of the pushbutton pin\r\nconst int iSwitch = D12;\r\n\/\/ variables will change:\r\nint switchState = 0;\r\nint iState = 0;\r\n\r\n\/\/ SD shield\r\nconst int chipSelect = D6;\r\n\/\/ FullString\r\nString FullString = &quot;&quot;;\r\nlong lineToRead = 0;\r\n\/\/ Random\r\nlong randNumber;\r\nString lineContent = &quot;&quot;;\r\nString zzzzzz = &quot;&quot;;\r\n\r\n\/\/ D11 LED Blue\r\nconst int iLedBlue = D11;\r\n\r\n\/\/ Software Version Information\r\nString sver = &quot;15-54&quot;;\r\n\r\nvoid loop() {\r\n  \r\n  \/\/ isGNSS\r\n  isGNSS();\r\n  \r\n  \/\/ AHT20 Humidity and Temperature Sensor\r\n  isHT();\r\n  \r\n  \/\/ RTC (Real-Time Clock)\r\n  isRTC();\r\n  \r\n  \/\/ isButton\r\n  isButton();\r\n\r\n  \/\/ isDisplay Button\r\n  isDisplayButton();\r\n\r\n}\r\n<\/pre>\n<p><strong>getButton.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Button\r\n\/\/ isButton\r\nvoid isButton(){\r\n\r\n  \/\/ Read input value\r\n  iButtonState= digitalRead(iButton); \r\n\r\n  if (iButtonState == HIGH) { \r\n      \r\n    \/\/  Switch\r\n    isSwitch();\r\n\r\n   } else {\r\n\r\n      \/\/ Turn LED Off\r\n      digitalWrite(iLedBlue, LOW);\r\n\r\n   }\r\n\r\n}\r\n<\/pre>\n<p><strong>getDisplay.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Adafruit SSD1306\r\n\/\/ isDisplayUID\r\nvoid isDisplayUID(){\r\n\r\n    \/\/ Intentar ambas direcciones\r\n  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {\r\n    \/\/Serial.println(&quot;Error con 0x3C, probando 0x3D...&quot;);\r\n    if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3D)) {\r\n      \/\/Serial.println(&quot;Error OLED en ambas direcciones&quot;);\r\n      return;\r\n    }\r\n  }\r\n  \r\n  \/\/ Clear Display\r\n  display.clearDisplay();\r\n  display.setTextSize(1);\r\n  display.setTextColor(SSD1306_WHITE);\r\n  \/\/ Don Luc Electronics\r\n  display.setCursor(0,0);\r\n  display.println(&quot;Don Luc Electronics&quot;);\r\n  \/\/ Motor Drive\r\n  display.setCursor(0,20);\r\n  display.print(&quot;DL2610Mk04&quot;);\r\n \/\/ Version\r\n  display.setCursor(0,20);\r\n  display.print(&quot;Version&quot;);\r\n  display.setCursor(0,40);\r\n  display.print( sver );\r\n  \/\/ Display\r\n  display.display();\r\n\r\n}\r\n\/\/ isDisplay Button\r\nvoid isDisplayButton(){\r\n\r\n  \/\/ Clear Display\r\n  display.clearDisplay();\r\n  display.setTextSize(1);\r\n  display.setTextColor(SSD1306_WHITE);\r\n  \/\/ Don Luc Electronics\r\n  display.setCursor(0,0);\r\n  display.println(&quot;Don Luc Electronics&quot;);\r\n  \/\/ \r\n  display.setCursor(0,20);\r\n  if (iState == 1) {\r\n\r\n    \/\/ English\r\n    display.print(&quot;Book English&quot;);\r\n\r\n  }\r\n  else {\r\n\r\n    \/\/ Spanish\r\n    display.print(&quot;Book Spanish&quot;);\r\n\r\n }  \r\n  \r\n  \/\/ Line Content\r\n  display.setCursor(0,40);\r\n  display.print( lineContent );\r\n  \/\/ Display\r\n  display.display();\r\n\r\n}\r\n<\/pre>\n<p><strong>getGNSS.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ GNSS\r\n\/\/ isSetupGNSS\r\nvoid isSetupGNSS(){\r\n  \r\n  \/\/ GNSS\r\n  while(!gnss.begin()){\r\n    \r\n    Serial.println(&quot;NO Deivces !&quot;);\r\n    delay(1000);\r\n\r\n  }\r\n  \r\n  \/\/ GNSS\r\n  gnss.enablePower(); \r\n\r\n\/** Set the galaxy to be used\r\n *   eGPS              USE gps\r\n *   eBeiDou           USE beidou\r\n *   eGPS_BeiDou       USE gps + beidou\r\n *   eGLONASS          USE glonass\r\n *   eGPS_GLONASS      USE gps + glonass\r\n *   eBeiDou_GLONASS   USE beidou +glonass\r\n *   eGPS_BeiDou_GLONASS USE gps + beidou + glonass\r\n *\/\r\n  gnss.setGnss(eGPS_BeiDou_GLONASS);\r\n\r\n  \/\/ GNSS\r\n  gnss.setRgbOn();\r\n  \r\n}\r\n\/\/ isGNSS\r\nvoid isGNSS(){\r\n\r\n  \/\/ GNSS\r\n  sTim_t utc = gnss.getUTC();\r\n  sTim_t date = gnss.getDate();\r\n  sLonLat_t lat = gnss.getLat();\r\n  sLonLat_t lon = gnss.getLon();\r\n  double high = gnss.getAlt();\r\n  \r\n  sDate = &quot;&quot;;\r\n  sUTC = &quot;&quot;;\r\n  sLat = &quot;&quot;;\r\n  sLon = &quot;&quot;;\r\n  sAlt = &quot;&quot;;\r\n  \/\/ Latitude\r\n  sLat = lat.latitudeDegree;\r\n  \/\/ Longitude\r\n  sLon = lon.lonitudeDegree;\r\n  \/\/ Altitude\r\n  sAlt = high;\r\n  \/\/ Date\r\n  sDate = date.year;\r\n  sDate = sDate + &quot;\/&quot;;\r\n  sDate = sDate + date.month;\r\n  sDate = sDate + &quot;\/&quot;;\r\n  sDate = sDate + date.date;\r\n  \/\/ UTC\r\n  sUTC = utc.hour;\r\n  sUTC = sUTC + &quot;:&quot;;\r\n  sUTC = sUTC + utc.hour;\r\n  sUTC = sUTC + &quot;:&quot;;\r\n  sUTC = sUTC + utc.minute;\r\n  \r\n}\r\n<\/pre>\n<p><strong>getHT.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ AHT20 Humidity and Temperature Sensor\r\nvoid isHT(){\r\n\r\n  if(aht20.startMeasurementReady(true)){\r\n\r\n    \/\/ Humidity\r\n    h = aht20.getHumidity_RH();\r\n  \r\n    \/\/ Temperature\r\n    t = aht20.getTemperature_C();\r\n    \r\n   }\r\n  \r\n}\r\n<\/pre>\n<p><strong>getRTC.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Real-Time Tlock\r\n\/\/ Date and Time RTC\r\nvoid isRTC () {\r\n\r\n  \/\/ Date and Time\r\n  dateRTC = &quot;&quot;;\r\n  timeRTC = &quot;&quot;;\r\n  rtc.read();\r\n  \r\n  \/\/ Date\r\n  dateRTC = rtc.year; \r\n  dateRTC = dateRTC + &quot;\/&quot;;\r\n  dateRTC = dateRTC + rtc.month;\r\n  dateRTC = dateRTC + &quot;\/&quot;;\r\n  dateRTC = dateRTC + rtc.day;\r\n\r\n  \/\/ Time\r\n  timeRTC = rtc.hour;\r\n  timeRTC = timeRTC + &quot;:&quot;;\r\n  timeRTC = timeRTC + rtc.minute;\r\n  timeRTC = timeRTC + &quot;:&quot;;\r\n  timeRTC = timeRTC + rtc.second;\r\n  \r\n}\r\n<\/pre>\n<p><strong>getSD.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ MicroSD Card\r\n\/\/ MicroSD Setup\r\nvoid isSetupSD() {\r\n\r\n    \/\/ MicroSD Card\r\n    pinMode( chipSelect , OUTPUT );\r\n    \r\n    \/\/ MicroSD Card\r\n    if(!SD.begin()){\r\n        Serial.print(&quot;MicroSD Card No&quot;);;  \r\n        return;\r\n    }\r\n    \r\n    uint8_t cardType = SD.cardType();\r\n\r\n    \/\/ CARD NONE\r\n    if(cardType == CARD_NONE){\r\n        ; \r\n        return;\r\n    }\r\n\r\n    \/\/ SD Card Type\r\n    if(cardType == CARD_MMC){\r\n        ; \r\n    } else if(cardType == CARD_SD){\r\n        ; \r\n    } else if(cardType == CARD_SDHC){\r\n        ; \r\n    } else {\r\n        ; \r\n    } \r\n\r\n    \/\/ Size\r\n    uint64_t cardSize = SD.cardSize() \/ (1024 * 1024);\r\n \r\n}\r\n\/\/ MicroSD Card English\r\nvoid isSDEnglish() {\r\n\r\n  zzzzzz = &quot;&quot;;\r\n\r\n  \/\/DLE|Version|Date|Time|\r\n  zzzzzz = &quot;DLE|&quot; + sver + &quot;|&quot; + String( dateRTC ) + &quot;|&quot; + String( timeRTC )  + &quot;|&quot;\r\n  \/\/GPS Date|UTC|Latitude|Longitude|Altitude|\r\n  + String( sDate ) + &quot;|&quot; + String( sUTC ) + &quot;|&quot; + String(sLat) + &quot;|&quot; + String(sLon) + &quot;|&quot; + String(sAlt) + &#039;|&#039;\r\n  \/\/Humidity|Temperature|\r\n  +  String( h ) + &quot;|&quot; + String( t )\r\n  \/\/|English|lineContent|\\r\r\n  + &quot;|English|&quot; + lineContent + &quot;|*\\r&quot;;\r\n\r\n  \/\/ msg + 1\r\n  char msg[zzzzzz.length() + 1];\r\n\r\n  zzzzzz.toCharArray(msg, zzzzzz.length() + 1);\r\n\r\n  \/\/ Append File\r\n  appendFile(SD, &quot;\/DLEDATA.txt&quot;, msg );\r\n\r\n}\r\n\/\/ MicroSD Card Spanish\r\nvoid isSDSpanish() {\r\n\r\n  zzzzzz = &quot;&quot;;\r\n\r\n  \/\/DLE|Version|Date|Time|\r\n  zzzzzz = &quot;DLE|&quot; + sver + &quot;|&quot; + String( dateRTC ) + &quot;|&quot; + String( timeRTC )  + &quot;|&quot;\r\n  \/\/GPS Date|UTC|Latitude|Longitude|Altitude|\r\n  + String( sDate ) + &quot;|&quot; + String( sUTC ) + &quot;|&quot; + String(sLat) + &quot;|&quot; + String(sLon) + &quot;|&quot; + String(sAlt) + &#039;|&#039;\r\n  \/\/Humidity|Temperature|\r\n  +  String( h ) + &quot;|&quot; + String( t )\r\n  \/\/|Spanish|lineContent|\\r\r\n  + &quot;|Spanish|&quot; + lineContent + &quot;|*\\r&quot;;\r\n  \r\n  \/\/ msg + 1\r\n  char msg[zzzzzz.length() + 1];\r\n\r\n  zzzzzz.toCharArray(msg, zzzzzz.length() + 1);\r\n\r\n  \/\/ Append File\r\n  appendFile(SD, &quot;\/DLEDATA.txt&quot;, msg );\r\n\r\n}\r\n\/\/ Read a specific line (1-indexed)\r\nString readSpecificLine(fs::FS &amp;fs, const char * path, int targetLine) {\r\n  File file = fs.open(path);\r\n  if(!file || file.isDirectory()){\r\n    return &quot;Error: Failed to open file&quot;;\r\n  }\r\n\r\n  int currentLine = 1;\r\n  String lineContent = &quot;&quot;;\r\n\r\n  while(file.available()){\r\n    char ch = file.read();\r\n    \r\n    if (currentLine == targetLine) {\r\n      if (ch == &#039;\\n&#039; || ch == &#039;\\r&#039;) {\r\n        file.close();\r\n        return lineContent; \/\/ Found line, return it\r\n      }\r\n      lineContent += ch;\r\n    }\r\n\r\n    if (ch == &#039;\\n&#039;) {\r\n      currentLine++;\r\n    }\r\n\r\n    if (currentLine &gt; targetLine) {\r\n      break; \r\n    }\r\n  }\r\n\r\n  file.close();\r\n  \r\n  if (currentLine == targetLine &amp;&amp; lineContent.length() &gt; 0) {\r\n    return lineContent; \/\/ Return last line if it lacks a trailing newline\r\n  }\r\n  \r\n  return &quot;Error: Line not found&quot;;\r\n}\r\n\/\/ List Dir\r\nvoid listDir(fs::FS &amp;fs, const char * dirname, uint8_t levels){\r\n    \r\n    \/\/ List Dir\r\n    dirname;\r\n    \r\n    File root = fs.open(dirname);\r\n    \r\n    if(!root){\r\n        return;\r\n    }\r\n    \r\n    if(!root.isDirectory()){\r\n        return;\r\n    }\r\n\r\n    File file = root.openNextFile();\r\n    \r\n    while(file){\r\n        if(file.isDirectory()){\r\n            file.name();\r\n            if(levels){\r\n                listDir(fs, file.name(), levels -1);\r\n            }\r\n        } else {\r\n            file.name();\r\n            file.size();\r\n        }\r\n        file = root.openNextFile();\r\n    }\r\n    \r\n}\r\n\/\/ Write File\r\nvoid writeFile(fs::FS &amp;fs, const char * path, const char * message){\r\n    \r\n    \/\/ Write File\r\n    path;\r\n    \r\n    File file = fs.open(path, FILE_WRITE);\r\n    \r\n    if(!file){\r\n        return;\r\n    }\r\n    \r\n    if(file.print(message)){\r\n        ;  \r\n    } else {\r\n        ;  \r\n    }\r\n    \r\n    file.close();\r\n    \r\n}\r\n\/\/ Append File\r\nvoid appendFile(fs::FS &amp;fs, const char * path, const char * message){\r\n\r\n    \/\/ Append File\r\n    path;\r\n    \r\n    File file = fs.open(path, FILE_APPEND);\r\n    \r\n    if(!file){\r\n        return;\r\n    }\r\n    \r\n    if(file.print(message)){\r\n        ;  \r\n    } else {\r\n        ;  \r\n    }\r\n    \r\n    file.close();\r\n\r\n}\r\n<\/pre>\n<p><strong>getSpeechSynthesizer.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Speech Synthesis\r\n\/\/ isSetupSS\r\nvoid isSetupSS(){\r\n\r\n  \/\/ Begin\r\n  ss.begin();\r\n  \/\/ Set voice volume to 9\r\n  ss.setVolume(9);\r\n  \/\/ Set playback speed to 9\r\n  ss.setSpeed(7);\r\n  \/\/ Set tone to 5\r\n  ss.setTone(5);\r\n  \/\/ For English, speak word \r\n  ss.setEnglishPron(ss.eWord);\r\n\r\n}\r\n<\/pre>\n<p><strong>getSwitch.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Switch\r\n\/\/ isSwitch\r\nvoid isSwitch(){\r\n\r\n  \/\/ Turn LED off:\r\n  digitalWrite(iLedBlue, LOW);\r\n\r\n  randNumber = random(1, 6);\r\n\r\n  if ( randNumber == 4 ) {\r\n\r\n     \/\/ Switch\r\n     switchState = digitalRead(iSwitch);\r\n\r\n     if (switchState == HIGH) {\r\n    \r\n       \/\/ Turn LED On:\r\n       digitalWrite(iLedBlue, HIGH);\r\n\r\n       iState = 1;\r\n       \r\n       \/\/ English\r\n       \/\/ Example: Read line from &quot;english\/engliso.txt&quot;\r\n       lineToRead = random(1, 2048);\r\n\r\n       lineContent = readSpecificLine(SD, &quot;\/english\/engliso.txt&quot;, lineToRead);\r\n            \r\n       if (lineContent != &quot;&quot;) {\r\n\r\n         Serial.print(&quot;Line &quot;);\r\n         Serial.print(lineToRead);\r\n         Serial.print(&quot;: &quot;);\r\n         Serial.println(lineContent);\r\n         \/\/ Speak\r\n         ss.speak( lineContent );\r\n         \/\/ MicroSD Card English\r\n         isSDEnglish();\r\n\r\n      } else {\r\n\r\n         Serial.println(&quot;Line not found or file error.&quot;);\r\n\r\n      }\r\n\r\n\r\n    } else {\r\n\r\n     \/\/ Turn LED On:\r\n     digitalWrite(iLedBlue, HIGH);\r\n\r\n     iState = 0;\r\n      \r\n      \/\/ Spanish\r\n      \/\/ Example: Read line from &quot;spanish\/spanisho.txt&quot;\r\n      lineToRead = random(1, 1938);\r\n\r\n      lineContent = readSpecificLine(SD, &quot;\/spanish\/spanisho.txt&quot;, lineToRead);\r\n\r\n      if (lineContent != &quot;&quot;) {\r\n\r\n         Serial.print(&quot;Line &quot;);\r\n         Serial.print(lineToRead);\r\n         Serial.print(&quot;: &quot;);\r\n         Serial.println(lineContent);\r\n         \/\/ Speak\r\n         ss.speak( lineContent );\r\n         \/\/ MicroSD Card Spanish\r\n         isSDSpanish();\r\n\r\n      } else {\r\n\r\n         Serial.println(&quot;Line not found or file error.&quot;);\r\n\r\n      }\r\n\r\n    }\r\n\r\n  }\r\n     \r\n}  \r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Setup\r\nvoid setup()\r\n{\r\n\r\n  \/\/ Delay\r\n  delay(100);\r\n  \r\n  \/\/ Serial\r\n  Serial.begin(9600);\r\n  \r\n  \/\/ Delay\r\n  delay( 100 );\r\n\r\n  \/\/ LED Blue\r\n  pinMode(iLedBlue, OUTPUT);\r\n\r\n  \/\/ Delay\r\n  delay(100);\r\n\r\n  \/\/ iButton\r\n  pinMode(iButton, INPUT);\r\n\r\n  delay(100);\r\n  \r\n  \/\/ iSwitch\r\n  pinMode(iSwitch, INPUT);\r\n\r\n  \/\/ Wire\r\n  Wire.begin();\r\n\r\n  \/\/ Delay\r\n  delay(100);\r\n\r\n  \/\/ Setup RTC\r\n  rtc.setup();\r\n\r\n  \/\/Set the RTC time automatically: Calibrate RTC time by your computer time\r\n  rtc.adjustRtc(F(__DATE__), F(__TIME__));\r\n\r\n  \/\/ Delay\r\n  delay(100);\r\n\r\n  \/\/MicroSD Card\r\n  isSetupSD();\r\n\r\n  \/\/ Delay\r\n  delay(100);\r\n\r\n  \/\/ isSetupSS\r\n  isSetupSS();\r\n\r\n  \/\/ Delay\r\n  delay(100);\r\n\r\n  \/\/ AHT20 Humidity and Temperature Sensor\r\n  aht20.begin();\r\n\r\n  \/\/ Delay\r\n  delay( 100 );\r\n\r\n  \/\/ isSetupGNSS\r\n  isSetupGNSS();\r\n\r\n  \/\/ Delay\r\n  delay( 100 );\r\n  \r\n  \/\/ Random Seed\r\n  randomSeed(analogRead(A3));\r\n\r\n  \/\/ Delay\r\n  delay( 100 );\r\n\r\n  \/\/ Adafruit SSD1306 - UID\r\n  \/\/ Don Luc Electronics\r\n  \/\/ Versioc\r\n  isDisplayUID();\r\n  \r\n  \/\/ Delay\r\n  delay( 5000 );\r\n\r\n}\r\n<\/pre>\n<p>&#8212;&#8212;<\/p>\n<p><strong>People can contact us:<\/strong> https:\/\/www.donluc.com\/?page_id=1927<\/p>\n<p><strong>Consultant, R&#038;D, Electronics, IoT, Teacher and Instructor<\/strong><\/p>\n<ul>\n<li>Programming Language<\/li>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi, Arm, Silicon Labs, Espressif, Etc&#8230;)<\/li>\n<li>IoT<\/li>\n<li>Wireless (Radio Frequency, Bluetooth, WiFi, Etc&#8230;)<\/li>\n<li>Robotics<\/li>\n<li>Automation<\/li>\n<li>Camera and Video Capture Receiver Stationary, Wheel\/Tank, Underwater and UAV Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial,  Marine and UAV<\/li>\n<li>Machine Learning<\/li>\n<li>Artificial Intelligence (AI)<\/li>\n<li>RTOS<\/li>\n<li>Sensors, eHealth Sensors, Biosensor, and Biometric<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<li>Consulting<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>Luc Paquin \u2013 Curriculum Vitae &#8211; 2026<\/strong><br \/>\nhttps:\/\/www.donluc.com\/luc\/LucPaquinCVEng2026Mk01.pdf<br \/>\nhttps:\/\/www.donluc.com\/luc\/<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.jlpconsultants.com\/<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/@thesass2063<br \/>\n<strong>DFRobot:<\/strong> https:\/\/learn.dfrobot.com\/user-10186.html<br \/>\n<strong>TikTok:<\/strong> https:\/\/www.tiktok.com\/@luc.paquin8<br \/>\n<strong>Hackster:<\/strong> https:\/\/www.hackster.io\/luc-paquin<br \/>\n<strong>LinkedIn:<\/strong> https:\/\/www.linkedin.com\/in\/jlucpaquin\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8212; #DonLucElectronics #DonLuc #GNSS #AHT20 #RTC #TextoSpeech #Environment #SD #FireBeetle2ESP32E #ESP32 #Display #IoT #Project #Fritzing #Programming #Electronics #Microcontrollers #Consultant &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; What Is GNSS? GNSS stands for Global Navigation Satellite System. It is the general term used for satellite-based positioning systems that allow receivers on Earth to determine their location. Several GNSS constellations &#8230; <a title=\"Project #15: Environment \u2013 GNSS \u2013 Mk54\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=5042\" aria-label=\"Read more about Project #15: Environment \u2013 GNSS \u2013 Mk54\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[106,47,50,49,317,38,80,59,115,5,287,58,82,10],"tags":[86,6,92,102,4,320,87,19,107,83,85,443,399,89,24,9,84,27,88,248,33,34,108],"class_list":["post-5042","post","type-post","status-publish","format-standard","hentry","category-environment","category-adafruit","category-arduino","category-consultant","category-dfrobot","category-digitalelectronics","category-esp32","category-fritzing","category-e-mentor","category-microcontrollers","category-program","category-arduino-programming","category-program-esp32","category-projects","tag-adafruit","tag-arduino","tag-battery","tag-components","tag-consultant","tag-dfrobot","tag-display","tag-electronics","tag-environment","tag-esp32","tag-fritzing","tag-gnss","tag-gnss-gps","tag-gps-receiver","tag-microcontroller","tag-programming","tag-programming-esp32","tag-projects-2","tag-rht03-humidity-and-temperature-sensor","tag-sensors","tag-technology","tag-video-blog","tag-vlog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/5042","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5042"}],"version-history":[{"count":2,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/5042\/revisions"}],"predecessor-version":[{"id":5048,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/5042\/revisions\/5048"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}