{"id":2820,"date":"2021-08-25T11:49:43","date_gmt":"2021-08-25T18:49:43","guid":{"rendered":"https:\/\/www.donluc.com\/?p=2820"},"modified":"2021-08-25T11:49:43","modified_gmt":"2021-08-25T18:49:43","slug":"project-19-time-qwiic-connect-system-mk08","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=2820","title":{"rendered":"Project #19: Time &#8211; Qwiic Connect System &#8211; Mk08"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-2820-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/08\/DL2108Mk09W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/08\/DL2108Mk09W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/08\/DL2108Mk09W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8211;<\/p>\n<p>#DonLucElectronics #DonLuc #Time #RTC #Display #Adalogger #MicroSD #GPSReceiver #CCS811 #BME280 #Arduino #ESP32 #SparkFunESP32WROOM #Project #Programming #Electronics #Microcontrollers #Consultant #VideoBlog #VideoBlog<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/08\/DL2108Mk09a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/08\/DL2108Mk09a.png\" alt=\"Qwiic Connect System\" width=\"720\" height=\"641\" class=\"alignnone size-full wp-image-2822\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/08\/DL2108Mk09a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/08\/DL2108Mk09a-300x267.png 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\/2021\/08\/DL2108Mk09b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/08\/DL2108Mk09b.png\" alt=\"Qwiic Connect System\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2823\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/08\/DL2108Mk09b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/08\/DL2108Mk09b-300x200.png 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\/2021\/08\/DL2108Mk09c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/08\/DL2108Mk09c.png\" alt=\"Qwiic Connect System\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2824\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/08\/DL2108Mk09c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/08\/DL2108Mk09c-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>Qwiic Connect System<\/strong><\/p>\n<p>Prototyping with I2C has never been easier. SparkFun&#8217;s Qwiic Connect System uses 4-pin JST connectors to quickly interface development boards with sensors, LCDs, relays and more.<\/p>\n<p><strong>DL2108Mk09<\/strong><\/p>\n<p>1 x SparkFun Thing Plus &#8211; ESP32 WROOM<br \/>\n1 x Adafruit SHARP Memory Display<br \/>\n1 x Adalogger FeatherWing &#8211; RTC + SD<br \/>\n1 x SparkFun Environmental Combo CCS811\/BME280 (Qwiic)<br \/>\n1 x CR1220 3V Lithium Coin Cell Battery<br \/>\n1 x 32Gb microSD Card<br \/>\n1 x LED Green<br \/>\n1 x Rocker Switch &#8211; SPST (Round)<br \/>\n1 x Terminal Block Breakout FeatherWing<br \/>\n1 x Lithium Ion Battery &#8211; 850mAh<br \/>\n1 x GPS Receiver &#8211; GP-20U7<br \/>\n1 x Rotary Switch &#8211; 10 Position<br \/>\n1 x SparkFun Rotary Switch \u2013 10 Position<br \/>\n1 x Black Knob<br \/>\n2 x Spring Terminals &#8211; PCB Mount (6-Pin)<br \/>\n2 x Breadboard Solderable<br \/>\n12 x 1K Ohm<br \/>\n1 x FeatherWing Proto<br \/>\n1 x Acrylic Orange 5.75 inches x 3.75 inches x 1\/8 inch<br \/>\n1 x Acrylic Black 5.75 inches x 3.75 inches x 1\/8 inch<br \/>\n52 x Screw &#8211; 4-40<br \/>\n18 x Standoff &#8211; Metal 4-40 &#8211; 3\/8&#8243;<br \/>\n8 x Standoff &#8211; Metal 4-40 &#8211; 1&#8243;<br \/>\n1 x SparkFun Cerberus USB Cable<\/p>\n<p><strong>SparkFun Thing Plus &#8211; ESP32 WROOM<\/strong><\/p>\n<p>SCK &#8211; Digital 13<br \/>\nMSI &#8211; Digital 12<br \/>\nSS0 &#8211; Digital 27<br \/>\nGRX &#8211; Digital 16<br \/>\nGTX &#8211; Digital 17<br \/>\nSDA &#8211; Digital 23<br \/>\nSDL &#8211; Digital 22<br \/>\nSCK &#8211; Digital 5<br \/>\nMSO &#8211; Digital 19<br \/>\nMSI &#8211; Digital 18<br \/>\nSS1 &#8211; Digital 33<br \/>\nLEG &#8211; Digital 21<br \/>\nSW0 &#8211; Digital 32<br \/>\nROT &#8211; Analog A0<br \/>\nVIN &#8211; +3.3V<br \/>\nGND &#8211; GND<\/p>\n<p><strong>DL2108Mk09p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/* \r\n***** Don Luc Electronics \u00a9 *****\r\nSoftware Version Information\r\nProject #19: Time - Qwiic Connect System - Mk08\r\n08-08\r\nDL2108Mk09p.ino\r\n1 x SparkFun Thing Plus - ESP32 WROOM\r\n1 x Adafruit SHARP Memory Display\r\n1 x Adalogger FeatherWing - RTC + SD\r\n1 x SparkFun Environmental Combo CCS811\/BME280 (Qwiic)\r\n1 x CR1220 3V Lithium Coin Cell Battery\r\n1 x 32Gb microSD Card\r\n1 x LED Green\r\n1 x Rocker Switch - SPST (Round)\r\n1 x Terminal Block Breakout FeatherWing\r\n1 x Lithium Ion Battery - 850mAh\r\n1 x GPS Receiver - GP-20U7\r\n1 x Rotary Switch - 10 Position\r\n1 x SparkFun Rotary Switch \u2013 10 Position\r\n1 x Black Knob\r\n2 x Spring Terminals - PCB Mount (6-Pin)\r\n2 x Breadboard Solderable\r\n12 x 1K Ohm\r\n1 x FeatherWing Proto\r\n1 x Acrylic Orange 5.75 inches x 3.75 inches x 1\/8 inch\r\n1 x Acrylic Black 5.75 inches x 3.75 inches x 1\/8 inch\r\n52 x Screw - 4-40\r\n18 x Standoff - Metal 4-40 - 3\/8&quot;\r\n8 x Standoff - Metal 4-40 - 1&quot;\r\n1 x SparkFun Cerberus USB Cable\r\n*\/\r\n\r\n\/\/ Include the Library Code\r\n\/\/ EEPROM Library to Read and Write EEPROM with Unique ID for Unit\r\n#include &quot;EEPROM.h&quot;\r\n\/\/ Wire\r\n#include &lt;Wire.h&gt;\r\n\/\/ SHARP Memory Display\r\n#include &lt;Adafruit_SharpMem.h&gt;\r\n#include &lt;Adafruit_GFX.h&gt;\r\n\/\/ Date and time RTC\r\n#include &quot;RTClib.h&quot;\r\n\/\/ GPS Receiver\r\n#include &lt;TinyGPS++.h&gt;\r\n\/\/ ESP32 Hardware Serial\r\n#include &lt;HardwareSerial.h&gt;\r\n\/\/ SD Card\r\n#include &quot;FS.h&quot;\r\n#include &quot;SD.h&quot;\r\n#include &quot;SPI.h&quot;\r\n\/\/ SparkFun CCS811 - eCO2 &amp; tVOC\r\n#include &lt;SparkFunCCS811.h&gt;\r\n\/\/ SparkFun BME280 - Humidity, Temperature, Altitude and Barometric Pressure\r\n#include &lt;SparkFunBME280.h&gt;\r\n\r\n\/\/ SHARP Memory Display\r\n#define SHARP_SCK  13\r\n#define SHARP_MOSI 12\r\n#define SHARP_SS   27\r\n\/\/ Set the size of the display here, e.g. 144x168!\r\nAdafruit_SharpMem display(SHARP_SCK, SHARP_MOSI, SHARP_SS, 144, 168);\r\n\/\/ The currently-available SHARP Memory Display (144x168 pixels)\r\n\/\/ requires &gt; 4K of microcontroller RAM; it WILL NOT WORK on Arduino Uno\r\n\/\/ or other &lt;4K &quot;classic&quot; devices.\r\n#define BLACK 0\r\n#define WHITE 1\r\n\r\n\/\/ Date and Time\r\n\/\/ PCF8523 Precision RTC \r\nRTC_PCF8523 rtc;\r\n\/\/ Date\r\nString dateRTC = &quot;&quot;;\r\n\/\/ Time\r\nString timeRTC = &quot;&quot;;\r\n\r\n\/\/ ESP32 HardwareSerial\r\nHardwareSerial tGPS(2);\r\n\r\n\/\/ GPS Receiver\r\n#define gpsRXPIN 16\r\n\/\/ This one is unused and doesnt have a conection\r\n#define gpsTXPIN 17\r\n\/\/ The TinyGPS++ object\r\nTinyGPSPlus gps;\r\n\/\/ Latitude\r\nfloat TargetLat;\r\n\/\/ Longitude\r\nfloat TargetLon;\r\n\/\/ GPS Date, Time, Speed, Altitude\r\n\/\/ GPS Date\r\nString TargetDat;\r\n\/\/ GPS Time\r\nString TargetTim;\r\n\/\/ GPS Speeds M\/S\r\nString TargetSMS;\r\n\/\/ GPS Speeds Km\/h\r\nString TargetSKH;\r\n\/\/ GPS Altitude Meters\r\nString TargetALT;\r\n\/\/ GPS Status\r\nString GPSSt = &quot;&quot;;\r\n\r\n\/\/ Rotary Switch - 10 Position\r\n\/\/ Number 1 =&gt; 10\r\nint iRotNum = A0;\r\n\/\/ iRotVal - Value \r\nint iRotVal = 0;\r\n\/\/ Number\r\nint z = 0;\r\n\r\n\/\/ MicroSD Card\r\nconst int chipSelect = 33;\r\nString zzzzzz = &quot;&quot;;\r\n\r\n\/\/ LED Green\r\nint iLEDGreen = 21;\r\n\r\n\/\/ Rocker Switch - SPST (Round)\r\nint iSS1 = 32;\r\n\/\/ State\r\nint iSS1State = 0;\r\n\r\n\/\/ SparkFun CCS811 - eCO2 &amp; tVOC\r\n\/\/ Default I2C Address\r\n#define CCS811_ADDR 0x5B \r\nCCS811 myCCS811(CCS811_ADDR);\r\n\/\/ eCO2\r\nfloat CCS811CO2 = 0;\r\n\/\/ TVOC\r\nfloat CCS811TVOC = 0;\r\n\r\n\/\/ SparkFun BME280 - Humidity, Temperature, Altitude and Barometric Pressure\r\nBME280 myBME280;\r\n\/\/ Temperature Celsius\r\nfloat BMEtempC = 0;\r\n\/\/ Humidity\r\nfloat BMEhumid = 0;\r\n\/\/ Altitude Meters\r\nfloat BMEaltitudeM = 0;\r\n\/\/ Barometric Pressure\r\nfloat BMEpressure = 0;\r\n\r\n\/\/ Software Version Information\r\n\/\/ EEPROM Unique ID Information\r\n#define EEPROM_SIZE 64\r\nString uid = &quot;&quot;;\r\n\/\/ Version\r\nString sver = &quot;19-08&quot;;\r\n\r\nvoid loop()\r\n{\r\n     \r\n  \/\/ Dates and Time\r\n  isRTC();\r\n\r\n  \/\/ isGPS\r\n  isGPS();\r\n\r\n  \/\/ SparkFun BME280 - Humidity, Temperature, Altitude and Barometric Pressure\r\n  isBME280();\r\n\r\n  \/\/ SparkFun CCS811 - eCO2 &amp; tVOC\r\n  isCCS811();\r\n\r\n  \/\/ Rotary Switch\r\n  isRot();\r\n\r\n  \/\/ Slide Switch\r\n  \/\/ Read the state of the iSS1 value\r\n  iSS1State = digitalRead(iSS1);\r\n  \r\n  \/\/ If it is the Slide Switch State is HIGH\r\n  if (iSS1State == HIGH) {\r\n\r\n    \/\/ iLEDGreen HIGH\r\n    digitalWrite(iLEDGreen,  HIGH );\r\n    \r\n    \/\/ MicroSD Card\r\n    isSD();\r\n\r\n  } else {\r\n\r\n    \/\/ iLEDGreen LOW\r\n    digitalWrite(iLEDGreen,  LOW );\r\n  \r\n  }\r\n\r\n  delay( 1000 );\r\n \r\n}\r\n<\/pre>\n<p><strong>getBME280.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ SparkFun BME280 - Humidity, Temperature, Altitude and Barometric Pressure\r\n\/\/ isBME280 - Humidity, Temperature, Altitude and Barometric Pressure\r\nvoid isBME280(){\r\n\r\n  \/\/ Temperature Celsius\r\n  BMEtempC = myBME280.readTempC();\r\n  \/\/ Humidity\r\n  BMEhumid = myBME280.readFloatHumidity();\r\n  \/\/ Altitude Meters\r\n  BMEaltitudeM = (myBME280.readFloatAltitudeMeters(), 2);\r\n  \/\/ Barometric Pressure\r\n  BMEpressure = myBME280.readFloatPressure();\r\n  \r\n}\r\n<\/pre>\n<p><strong>getCCS811.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ CCS811 - eCO2 &amp; tVOC\r\n\/\/ isCCS811 - eCO2 &amp; tVOC\r\nvoid isCCS811(){\r\n\r\n  \/\/ This sends the temperature &amp; humidity data to the CCS811\r\n  myCCS811.setEnvironmentalData(BMEhumid, BMEtempC);\r\n\r\n  \/\/ Calling this function updates the global tVOC and eCO2 variables\r\n  myCCS811.readAlgorithmResults();\r\n\r\n  \/\/ eCO2 Concentration\r\n  CCS811CO2 = myCCS811.getCO2();\r\n  \r\n  \/\/ tVOC Concentration\r\n  CCS811TVOC = myCCS811.getTVOC();\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\/\/ SHARP Memory Display\r\n\/\/ SHARP Memory Display - UID\r\nvoid isDisplayUID() {\r\n\r\n    \/\/ Text Display \r\n    \/\/ Clear Display\r\n    display.clearDisplay();\r\n    display.setRotation(4);\r\n    display.setTextSize(3);\r\n    display.setTextColor(BLACK);\r\n    \/\/ Don Luc Electronics\r\n    display.setCursor(0,10);\r\n    display.println( &quot;Don Luc&quot; );\r\n    display.setTextSize(2);\r\n    display.setCursor(0,40);\r\n    display.println( &quot;Electronics&quot; );\r\n    \/\/ Version\r\n    \/\/display.setTextSize(3);\r\n    display.setCursor(0,70);\r\n    display.println( &quot;Version&quot; );\r\n    \/\/display.setTextSize(2);\r\n    display.setCursor(0,95);   \r\n    display.println( sver );\r\n    \/\/ EEPROM\r\n    display.setCursor(0,120);\r\n    display.println( &quot;EEPROM&quot; );\r\n    display.setCursor(0,140);   \r\n    display.println( uid );\r\n    \/\/ Refresh\r\n    display.refresh();\r\n    delay( 100 );\r\n    \r\n}\r\n\/\/ Display Date\r\nvoid isDisplayDate() {\r\n\r\n    \/\/ Text Display Date\r\n    \/\/ Clear Display\r\n    display.clearDisplay();\r\n    display.setRotation(4);\r\n    display.setTextSize(2);\r\n    display.setTextColor(BLACK);\r\n    \/\/ Date\r\n    display.setCursor(0,5);\r\n    display.println( &quot;Date&quot; );\r\n    display.setCursor(0,30);\r\n    display.println( dateRTC );\r\n    \/\/ Time\r\n    display.setCursor(0,55);\r\n    display.println( &quot;Time&quot; );\r\n    display.setCursor(0,75);\r\n    display.println( timeRTC );\r\n    \/\/ Refresh\r\n    display.refresh();\r\n    delay( 100 );\r\n\r\n}\r\n\/\/ Display GPS\r\nvoid isDisplayGPS() {\r\n\r\n    \/\/ Text Display Date\r\n    \/\/ Clear Display\r\n    display.clearDisplay();\r\n    display.setRotation(4);\r\n    display.setTextSize(2);\r\n    display.setTextColor(BLACK);\r\n    \/\/ GPS Status\r\n    display.setCursor(0,5);\r\n    display.print( &quot;GPS: &quot; );\r\n    display.println( GPSSt );\r\n    \/\/ Target Latitude\r\n    display.setCursor(0,25);\r\n    display.println( &quot;Latitude&quot; );\r\n    display.setCursor(0,45);\r\n    display.println( TargetLat );\r\n    \/\/ Target Longitude\r\n    display.setCursor(0,65);\r\n    display.println( &quot;Longitude&quot; );\r\n    display.setCursor(0,90);\r\n    display.println( TargetLon );\r\n    \/\/ Refresh\r\n    display.refresh();\r\n    delay( 100 );\r\n\r\n}\r\n\/\/ GPS Date, Time, Speed, Altitude\r\nvoid isDisplayGPSDate() {\r\n\r\n    \/\/ Text Display Date\r\n    \/\/ Clear Display\r\n    display.clearDisplay();\r\n    display.setRotation(4);\r\n    display.setTextSize(2);\r\n    display.setTextColor(BLACK);\r\n    \/\/ GPS\r\n    display.setCursor(0,5);\r\n    display.println( &quot;GPS&quot; );\r\n    \/\/ Date\r\n    display.setCursor(0,30);\r\n    display.println( TargetDat );\r\n    \/\/ Time\r\n    display.setCursor(0,55);\r\n    display.println( TargetTim );\r\n    \/\/ Speed\r\n    display.setCursor(0,75);\r\n    display.print( &quot;M\/S: &quot; );\r\n    display.println( TargetSMS );\r\n    display.setCursor(0,95);\r\n    display.print( &quot;Km\/h: &quot; );\r\n    display.println( TargetSKH );\r\n    display.setCursor(0,115);\r\n    display.print( &quot;Alt: &quot; );\r\n    display.println( TargetALT );\r\n    \/\/ Refresh\r\n    display.refresh();\r\n    delay( 100 );\r\n\r\n}\r\n\/\/ Display BME280 - Humidity, Temperature, Altitude and Barometric Pressure\r\nvoid isDisplayBME280() {\r\n\r\n     \/\/ Text Display BME280\r\n    \/\/ Clear Display\r\n    display.clearDisplay();\r\n    display.setRotation(4);\r\n    display.setTextSize(2);\r\n    display.setTextColor(BLACK);\r\n    \/\/ Temperature Celsius\r\n    display.setCursor(0,10);\r\n    display.println( &quot;Temperature&quot; );\r\n    display.setCursor(0,30);\r\n    display.print( BMEtempC );\r\n    display.println( &quot; C&quot; );\r\n    \/\/ Humidity\r\n    display.setCursor(0,50);\r\n    display.println( &quot;Humidity&quot; );\r\n    display.setCursor(0,70);\r\n    display.print( BMEhumid );\r\n    display.println( &quot;%&quot; );\r\n    \/\/ Altitude Meters\r\n    display.setCursor(0,90);\r\n    display.println( &quot;Altitude M&quot; );\r\n    display.setCursor(0,110);\r\n    display.print( BMEaltitudeM );\r\n    display.println( &quot; m&quot; );\r\n    \/\/ Pressure\r\n    display.setCursor(0,130);    \r\n    display.println( &quot;Barometric&quot; );\r\n    display.setCursor(0,150);\r\n    display.print( BMEpressure );\r\n    display.println( &quot;Pa&quot; );\r\n    \/\/ Refresh\r\n    display.refresh();\r\n    delay( 100 );\r\n\r\n}\r\n\/\/ Display CCS811 - eCO2 &amp; tVOC\r\nvoid isDisplayCCS811() {\r\n\r\n    \/\/ Text Display CCS811\r\n    \/\/ Clear Display\r\n    display.clearDisplay();\r\n    display.setRotation(4);\r\n    display.setTextSize(2);\r\n    display.setTextColor(BLACK);\r\n    \/\/ eCO2 Concentration\r\n    display.setCursor(0,10);\r\n    display.println( &quot;eCO2&quot; );\r\n    display.setCursor(0,30);\r\n    display.print( CCS811CO2 );\r\n    display.println( &quot; ppm&quot; );\r\n    \/\/ tVOC Concentration\r\n    display.setCursor(0,60);\r\n    display.println( &quot;tVOC&quot; );\r\n    display.setCursor(0,80);\r\n    display.print( CCS811TVOC );\r\n    display.println( &quot; ppb&quot; );\r\n    \/\/ Refresh\r\n    display.refresh();\r\n    delay( 100 );\r\n\r\n}\r\n\/\/ Display Z\r\nvoid isDisplayZ() {\r\n    \/\/ Text Display Z\r\n    \/\/ Clear Display\r\n    display.clearDisplay();\r\n    display.setRotation(4);\r\n    display.setTextSize(3);\r\n    display.setTextColor(BLACK);\r\n    \/\/ Z\r\n    display.setCursor(0,10);\r\n    display.print( &quot;Z: &quot; );\r\n    display.println( z );\r\n    \/\/ Refresh\r\n    display.refresh();\r\n    delay( 100 );\r\n}\r\n<\/pre>\n<p><strong>getEEPROM.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ EEPROM\r\n\/\/ isUID EEPROM Unique ID\r\nvoid isUID()\r\n{\r\n  \r\n  \/\/ Is Unit ID\r\n  uid = &quot;&quot;;\r\n  for (int x = 0; x &lt; 5; x++)\r\n  {\r\n    uid = uid + char(EEPROM.read(x));\r\n  }\r\n  \r\n}\r\n<\/pre>\n<p><strong>getGPS.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ GPS Receiver\r\n\/\/ Setup GPS\r\nvoid setupGPS() {\r\n\r\n  \/\/ Setup GPS\r\n  tGPS.begin(  9600 , SERIAL_8N1 , gpsRXPIN , gpsTXPIN );\r\n  \r\n}\r\n\/\/ isGPS\r\nvoid isGPS(){\r\n\r\n  \/\/ Receives NEMA data from GPS receiver\r\n  \/\/ This sketch displays information every time a new sentence is correctly encoded\r\n  while ( tGPS.available() &gt; 0)\r\n    \r\n    if (gps.encode( tGPS.read() ))\r\n    {\r\n     \r\n       \/\/ GPS Vector Pointer Target\r\n       displayInfo();\r\n       \/\/ GPS Date, Time, Speed, Altitude\r\n       displayDTS();\r\n       \r\n    }\r\n  \r\n  if (millis() &gt; 5000 &amp;&amp; gps.charsProcessed() &lt; 10)\r\n  {\r\n   \r\n     while(true);\r\n    \r\n  }\r\n\r\n}\r\n\/\/ GPS Vector Pointer Target\r\nvoid displayInfo(){\r\n\r\n  \/\/ Location\r\n  if (gps.location.isValid())\r\n  {\r\n    \r\n     \/\/ Latitude\r\n     TargetLat = gps.location.lat();\r\n     \/\/ Longitude\r\n     TargetLon = gps.location.lng();\r\n     \/\/ GPS Status 2\r\n     GPSSt = &quot;Yes&quot;;\r\n    \r\n  }\r\n  else\r\n  {\r\n\r\n     \/\/ GPS Status 0\r\n     GPSSt = &quot;No&quot;;\r\n    \r\n  }\r\n\r\n}\r\n\/\/ GPS Date, Time, Speed, Altitude\r\nvoid displayDTS(){\r\n\r\n  \/\/ Date\r\n  TargetDat = &quot;&quot;; \r\n  if (gps.date.isValid())\r\n  {\r\n    \r\n     \/\/ Date\r\n     \/\/ Year\r\n     TargetDat += String(gps.date.year(), DEC);\r\n     TargetDat += &quot;\/&quot;;\r\n     \/\/ Month\r\n     TargetDat += String(gps.date.month(), DEC);\r\n     TargetDat += &quot;\/&quot;;\r\n     \/\/ Day\r\n     TargetDat += String(gps.date.day(), DEC);\r\n    \r\n  }\r\n\r\n  \/\/ Time\r\n  TargetTim = &quot;&quot;;\r\n  if (gps.time.isValid())\r\n  {\r\n    \r\n     \/\/ Time\r\n     \/\/ Hour\r\n     TargetTim += String(gps.time.hour(), DEC);\r\n     TargetTim += &quot;:&quot;;\r\n     \/\/ Minute\r\n     TargetTim += String(gps.time.minute(), DEC);\r\n     TargetTim += &quot;:&quot;;\r\n     \/\/ Secound\r\n     TargetTim += String(gps.time.second(), DEC);\r\n    \r\n  }\r\n\r\n  \/\/ Speed\r\n  TargetSMS = &quot;&quot;;\r\n  TargetSKH = &quot;&quot;;\r\n  if (gps.speed.isValid())\r\n  {\r\n    \r\n     \/\/ Speed\r\n     \/\/ M\/S\r\n     int x = gps.speed.mps();\r\n     TargetSMS = String( x, DEC);\r\n     \/\/ Km\/h\r\n     int y = gps.speed.kmph();\r\n     TargetSKH = String( y, DEC);\r\n\r\n  }\r\n\r\n  \/\/ Altitude\r\n  TargetALT = &quot;&quot;;\r\n  if (gps.altitude.isValid())\r\n  {\r\n    \r\n     \/\/ Altitude\r\n     \/\/ Meters\r\n     int z = gps.altitude.meters();\r\n     TargetALT = String( z, DEC);\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\/\/ Date &amp; Time\r\n\/\/ PCF8523 Precision RTC\r\nvoid setupRTC() {\r\n\r\n  \/\/ Date &amp; Time\r\n  \/\/ pcf8523 Precision RTC   \r\n  if (! rtc.begin()) {\r\n    while (1);\r\n  }  \r\n  \r\n  if (! rtc.initialized()) {\r\n    \r\n    \/\/ Following line sets the RTC to the date &amp; time this sketch was compiled\r\n    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));\r\n    \/\/ This line sets the RTC with an explicit date &amp; time, for example to set\r\n    \/\/ January 21, 2014 at 3am you would call:\r\n    \/\/ rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));\r\n    \/\/ rtc.adjust(DateTime(2021, 8, 18, 8, 48, 0));\r\n    \r\n  }\r\n  \r\n}\r\n\/\/ Date and Time RTC PCF8523\r\nvoid isRTC () {\r\n\r\n  \/\/ Date and Time\r\n  dateRTC = &quot;&quot;;\r\n  timeRTC = &quot;&quot;;\r\n  DateTime now = rtc.now();\r\n  \r\n  \/\/ Date\r\n  \/\/ Year\r\n  dateRTC = now.year(), DEC; \r\n  dateRTC = dateRTC + &quot;\/&quot;;\r\n  \/\/ Month\r\n  dateRTC = dateRTC + now.month(), DEC;\r\n  dateRTC = dateRTC + &quot;\/&quot;;\r\n  \/\/ Day\r\n  dateRTC = dateRTC + now.day(), DEC;\r\n  \r\n  \/\/ Time\r\n  \/\/ Hour\r\n  timeRTC = now.hour(), DEC;\r\n  timeRTC = timeRTC + &quot;:&quot;;\r\n  \/\/ Minute\r\n  timeRTC = timeRTC + now.minute(), DEC;\r\n  timeRTC = timeRTC + &quot;:&quot;;\r\n  \/\/ Second\r\n  timeRTC = timeRTC + now.second(), DEC;\r\n  \r\n}\r\n<\/pre>\n<p><strong>getRot.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Rotary Switch\r\n\/\/ isRot - iRotVal - Value\r\nvoid isRot() {\r\n  \r\n  \/\/ Rotary Switch\r\n  z = analogRead( iRotNum );\r\n  \r\n  \/\/ Rotary Switch - 10 Position\r\n  \/\/ Number 1 =&gt; 10\r\n  if ( z &gt;= 3600 ) {\r\n\r\n    \/\/ Z\r\n    iRotVal = 10;\r\n    \r\n  } else if ( z &gt;= 3200 ) {\r\n\r\n    \/\/ Z\r\n    iRotVal = 9;\r\n    \r\n  } else if ( z &gt;= 2700 ) {\r\n\r\n    \/\/ Z\r\n    iRotVal = 8;\r\n    \r\n  } else if ( z &gt;= 2400 ) {\r\n\r\n    \/\/ Z\r\n    iRotVal = 7;\r\n    \r\n  } else if ( z &gt;= 2000 ) {\r\n\r\n    \/\/ Z\r\n    iRotVal = 6;\r\n    \r\n  } else if ( z &gt;= 1600 ) {\r\n\r\n    \/\/ Z\r\n    iRotVal = 5;\r\n    \r\n  } else if ( z &gt;= 1200 ) {\r\n\r\n    \/\/ Z\r\n    iRotVal = 4;\r\n    \r\n  } else if ( z &gt;= 900 ) {\r\n\r\n    \/\/ Z\r\n    iRotVal = 3;\r\n    \r\n  } else if ( z &gt;= 500 ) {\r\n\r\n    \/\/ Z\r\n    iRotVal = 2;\r\n    \r\n  } else {\r\n\r\n    \/\/ Z\r\n    iRotVal = 1;\r\n    \r\n  }\r\n\r\n  \/\/ Range Value\r\n  switch ( iRotVal ) {\r\n    case 1:\r\n\r\n      \/\/ Display Date, Time\r\n      isDisplayDate();\r\n       \r\n      break;\r\n    case 2:\r\n\r\n      \/\/ Display GPS\r\n      isDisplayGPS();\r\n         \r\n      break;\r\n    case 3:\r\n\r\n      \/\/ GPS Date, Time, Speed, Altitude\r\n      \/\/isDisplayGPSDate();\r\n      \r\n      break;  \r\n    case 4:\r\n      \r\n      \/\/ GPS Display Date, Time, Speed\r\n      isDisplayGPSDate();\r\n      \r\n      break;\r\n    case 5:\r\n      \r\n      \/\/ Display BME280\r\n      isDisplayBME280();\r\n      \r\n      break;\r\n    case 6:\r\n      \r\n      \/\/ Display CCS811 - eCO2 &amp; tVOC\r\n      isDisplayCCS811();\r\n      \r\n      break;       \r\n    case 7:\r\n\r\n      \/\/ Z\r\n      isDisplayZ();\r\n      \r\n      break; \r\n    case 8:\r\n         \r\n      \/\/ Z\r\n      isDisplayZ();\r\n      \r\n      break; \r\n    case 9:\r\n      \r\n      \/\/ Z\r\n      isDisplayZ();\r\n      \r\n      break;\r\n    case 10:\r\n\r\n      \/\/ Z\r\n      isDisplayZ();\r\n      \r\n      break;\r\n  }\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 setupSD() {\r\n\r\n    \/\/ MicroSD Card\r\n    pinMode( chipSelect , OUTPUT );\r\n    if(!SD.begin( chipSelect )){\r\n        ;  \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\r\nvoid isSD() {\r\n\r\n  zzzzzz = &quot;&quot;;\r\n\r\n  \/\/ EEPROM Unique ID|Version|Date|Time|GPS Status|Target Latitude|Target Longitude|GPS Date|GPS Time|GPS Speed M\/S|GPS Speed Km\/h|GPS Altitude|Temperature Celsius|Humidity|Altitude Meters|Barometric Pressure|eCO2 Concentration|tVOC Concentration|\\r\r\n  zzzzzz = uid + &quot;|&quot; + sver + &quot;|&quot; + dateRTC + &quot;|&quot; + timeRTC + &quot;|&quot; + GPSSt + &quot;|&quot; + TargetLat + &quot;|&quot; + TargetLon + &quot;|&quot; + TargetDat + &quot;|&quot; + TargetTim + &quot;|&quot; + TargetSMS + &quot;|&quot; + TargetSKH + &quot;|&quot; + TargetALT  + &quot;|&quot; + BMEtempC + &quot;|&quot; + BMEhumid + &quot;|&quot; + BMEaltitudeM + &quot;|&quot; + BMEpressure + &quot;|&quot; + CCS811CO2 + &quot;|&quot; + CCS811TVOC +  + &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;\/espdata.txt&quot;, msg );\r\n  \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>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  \/\/ EEPROM Size\r\n  EEPROM.begin(EEPROM_SIZE);\r\n  \r\n  \/\/ EEPROM Unique ID\r\n  isUID();\r\n  \r\n  \/\/ GPS Receiver\r\n  \/\/ Setup GPS\r\n  setupGPS();\r\n\r\n  \/\/ Set up I2C bus\r\n  Wire.begin();\r\n\r\n  \/\/ SparkFun BME280 - Humidity, Temperature, Altitude and Barometric Pressure\r\n  myBME280.begin();\r\n  \r\n  \/\/ CCS811 - eCO2 &amp; tVOC\r\n  myCCS811.begin();\r\n  \r\n  \/\/ SHARP Display Start &amp; Clear the Display\r\n  display.begin();\r\n  \/\/ Clear Display\r\n  display.clearDisplay();\r\n\r\n  \/\/ Date &amp; Time RTC\r\n  \/\/ PCF8523 Precision RTC\r\n  isDisplayUID();\r\n  \r\n  \/\/ Setup RTC\r\n  setupRTC();\r\n\r\n  \/\/MicroSD Card\r\n  setupSD();\r\n\r\n  \/\/ Initialize the LED Green\r\n  pinMode(iLEDGreen, OUTPUT);\r\n\r\n  \/\/ Slide Switch\r\n  pinMode(iSS1, INPUT);\r\n\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>Technology Experience<\/strong><\/p>\n<ul>\n<li>Single-Board Microcontrollers (PIC, Arduino, Raspberry Pi,Espressif, etc&#8230;)<\/li>\n<li>IoT<\/li>\n<li>Robotics<\/li>\n<li>Research &#038; Development (R &#038; D)<\/li>\n<li>Desktop Applications (Windows, OSX, Linux, Multi-OS, Multi-Tier, etc&#8230;)<\/li>\n<li>Mobile Applications (Android, iOS, Blackberry, Windows Mobile, Windows CE, etc&#8230;)<\/li>\n<li>Web Applications (LAMP, Scripting, Java, ASP, ASP.NET, RoR, Wakanda, etc&#8230;)<\/li>\n<li>Social Media Programming &#038; Integration (Facebook, Twitter, YouTube, Pinterest, etc&#8230;)<\/li>\n<li>Content Management Systems (WordPress, Drupal, Joomla, Moodle, etc&#8230;)<\/li>\n<li>Bulletin Boards (phpBB, SMF, Vanilla, jobberBase, etc&#8230;)<\/li>\n<li>eCommerce (WooCommerce, OSCommerce, ZenCart, PayPal Shopping Cart, etc&#8230;)<\/li>\n<\/ul>\n<p><strong>Instructor<\/strong><\/p>\n<ul>\n<li>PIC Microcontrollers<\/li>\n<li>Arduino<\/li>\n<li>Raspberry Pi<\/li>\n<li>Espressif<\/li>\n<li>Robotics<\/li>\n<li>DOS, Windows, OSX, Linux, iOS, Android, Multi-OS<\/li>\n<li>Linux-Apache-PHP-MySQL<\/li>\n<\/ul>\n<p><strong>Follow Us<\/strong><\/p>\n<p><strong>J. Luc Paquin \u2013 Curriculum Vitae &#8211; 2021 English &#038; Espa\u00f1ol<\/strong><br \/>\nhttps:\/\/www.jlpconsultants.com\/CV\/LucPaquinCVEngMk2021c.pdf<br \/>\nhttps:\/\/www.jlpconsultants.com\/CV\/LucPaquinCVEspMk2021c.pdf<\/p>\n<p><strong>Web:<\/strong> https:\/\/www.donluc.com\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.jlpconsultants.com\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.donluc.com\/DLE\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.donluc.com\/DLHackster\/<br \/>\n<strong>Web:<\/strong> https:\/\/www.hackster.io\/neosteam-labs<br \/>\n<strong>Web:<\/strong> https:\/\/zoom.us\/<br \/>\n<strong>Patreon:<\/strong> https:\/\/www.patreon.com\/DonLucElectronics<br \/>\n<strong>Facebook:<\/strong> https:\/\/www.facebook.com\/neosteam.labs.9\/<br \/>\n<strong>YouTube:<\/strong> https:\/\/www.youtube.com\/channel\/UC5eRjrGn1CqkkGfZy0jxEdA<br \/>\n<strong>Twitter:<\/strong> https:\/\/twitter.com\/labs_steam<br \/>\n<strong>Pinterest:<\/strong> https:\/\/www.pinterest.com\/NeoSteamLabs\/<br \/>\n<strong>Instagram:<\/strong> https:\/\/www.instagram.com\/neosteamlabs\/<\/p>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212;&#8211; #DonLucElectronics #DonLuc #Time #RTC #Display #Adalogger #MicroSD #GPSReceiver #CCS811 #BME280 #Arduino #ESP32 #SparkFunESP32WROOM #Project #Programming #Electronics #Microcontrollers #Consultant #VideoBlog #VideoBlog &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; Qwiic Connect System Prototyping with I2C has never been easier. SparkFun&#8217;s Qwiic Connect System uses 4-pin JST connectors to quickly interface development boards with sensors, LCDs, relays and more. DL2108Mk09 &#8230; <a title=\"Project #19: Time &#8211; Qwiic Connect System &#8211; Mk08\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=2820\" aria-label=\"Read more about Project #19: Time &#8211; Qwiic Connect System &#8211; Mk08\">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":[166,47,49,38,80,59,5,138,82,10,43],"tags":[86,6,92,102,4,87,19,83,85,89,24,9,84,27,173,109,33,34],"class_list":["post-2820","post","type-post","status-publish","format-standard","hentry","category-time","category-adafruit","category-consultant","category-digitalelectronics","category-esp32","category-fritzing","category-microcontrollers","category-patreon","category-program-esp32","category-projects","category-sparkfun","tag-adafruit","tag-arduino","tag-battery","tag-components","tag-consultant","tag-display","tag-electronics","tag-esp32","tag-fritzing","tag-gps-receiver","tag-microcontroller","tag-programming","tag-programming-esp32","tag-projects-2","tag-qwiic-connect-system","tag-sparkfun","tag-technology","tag-video-blog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2820","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=2820"}],"version-history":[{"count":2,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2820\/revisions"}],"predecessor-version":[{"id":4205,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2820\/revisions\/4205"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2820"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2820"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}