{"id":2880,"date":"2021-10-08T06:27:37","date_gmt":"2021-10-08T13:27:37","guid":{"rendered":"https:\/\/www.donluc.com\/?p=2880"},"modified":"2021-10-08T06:27:37","modified_gmt":"2021-10-08T13:27:37","slug":"project-15-environment-rgb-lcd-shield-16x2-character-display-mk15","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=2880","title":{"rendered":"Project #15: Environment \u2013 RGB LCD Shield 16&#215;2 Character Display \u2013 Mk15"},"content":{"rendered":"<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-2880-1\" width=\"720\" height=\"480\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/10\/DL2110Mk02W.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/10\/DL2110Mk02W.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/10\/DL2110Mk02W.mp4<\/a><\/video><\/div>\n<p>&#8212;&#8212;<\/p>\n<p>#DonLucElectronics #DonLuc #Environment #MQ #PIR #RHT03 #ArduinoUNO #Arduino #AdafruitPowerBoost #Project #Programming #Electronics #Microcontrollers #Consultant #VideoBlog<\/p>\n<p>&#8212;&#8212;<\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/10\/DL2110Mk02a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/10\/DL2110Mk02a.png\" alt=\"RGB LCD Shield 16x2 Character Display\" width=\"720\" height=\"545\" class=\"alignnone size-full wp-image-2882\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/10\/DL2110Mk02a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/10\/DL2110Mk02a-300x227.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\/10\/DL2110Mk02b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/10\/DL2110Mk02b.png\" alt=\"RGB LCD Shield 16x2 Character Display\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2883\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/10\/DL2110Mk02b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/10\/DL2110Mk02b-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\/10\/DL2110Mk02c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/10\/DL2110Mk02c.png\" alt=\"RGB LCD Shield 16x2 Character Display\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2884\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/10\/DL2110Mk02c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/10\/DL2110Mk02c-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\/10\/DL2110Mk02d.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/10\/DL2110Mk02d.png\" alt=\"RGB LCD Shield 16x2 Character Display\" width=\"720\" height=\"480\" class=\"alignnone size-full wp-image-2885\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/10\/DL2110Mk02d.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2021\/10\/DL2110Mk02d-300x200.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p>&#8212;&#8212;<\/p>\n<p><strong>RGB LCD Shield 16&#215;2 Character Negative Display<\/strong><\/p>\n<p>With this in mind, we wanted to make it easier for people to get these LCD into their projects so we devised a shield that lets you control a 16&#215;2 Character LCD, up to 3 backlight pins AND 5 keypad pins using only the two I2C pins on the Arduino. The shield is designed for Arduinos Uno. It uses the I2C pins at Analog 4 and Analog 5. <\/p>\n<p>At this time, the library and shield can control the RGB backlight of our character LCDs by turning each LED on or off. This means you can display the following colors: Red, Yellow, Green, Teal, Blue, Violet, White and all off. This shield is perfect for when you want to build a stand-alone project with its own user interface. The 4 directional buttons plus select button allows basic control without having to attach a bulky computer. <\/p>\n<p><strong>Adjusting Contrast<\/strong><\/p>\n<p>The shield uses a character LCD with an external contrast potentiometer. The first time you use it, adjust the potentiometer in the bottom right until you see the text clearly.<\/p>\n<p><strong>DL2110Mk02<\/strong><\/p>\n<p>1 x Arduino UNO &#8211; R3<br \/>\n1 x ProtoScrewShield<br \/>\n1 x RGB LCD Shield 16&#215;2 Character Negative Display<br \/>\n1 x Adafruit PowerBoost 500 Shield<br \/>\n1 x Lithium Ion Battery &#8211; 3.7v 2000mAh<br \/>\n4 x Pololu Carrier for MQ Gas Sensors<br \/>\n1 x SparkFun Hydrogen Gas Sensor &#8211; MQ-8<br \/>\n1 x 4.7K Ohm<br \/>\n1 x Pololu Carbon Monoxide &#038; Flammable Gas Sensor &#8211; MQ-9<br \/>\n1 x 22k Ohm<br \/>\n1 x SparkFun Carbon Monoxide Gas Sensor &#8211; MQ-7<br \/>\n1 x 10K Ohm<br \/>\n1 x SparkFun Alcohol Gas Sensor &#8211; MQ-3<br \/>\n1 x 220k Ohm<br \/>\n1 x Temperature and Humidity Sensor- RHT03<br \/>\n1 x PIR Motion Sensor (JST)<br \/>\n1 x SparkFun Solderable Half-Breadboard<br \/>\n1 x SparkFun Cerberus USB Cable<\/p>\n<p><strong>Arduino UNO &#8211; R3<\/strong><\/p>\n<p>RHT &#8211; Digital 5<br \/>\nPIR &#8211; Digital 7<br \/>\nMQ8 &#8211; Analog 0<br \/>\nMQ9 &#8211; Analog 1<br \/>\nMQ7 &#8211; Analog 2<br \/>\nMQ3 &#8211; Analog 3<br \/>\nSDA &#8211; Analog 4<br \/>\nSCL &#8211; Analog 5<br \/>\nVIN &#8211; +5V<br \/>\nGND &#8211; GND<\/p>\n<p><strong>DL2110Mk02p.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 #15: Environment \u2013 RGB LCD Shield 16x2 Character Display \u2013 Mk15\r\n10-02\r\nDL2110Mk02p.ino\r\n1 x Arduino UNO - R3\r\n1 x ProtoScrewShield\r\n1 x RGB LCD Shield 16x2 Character Negative Display\r\n1 x Adafruit PowerBoost 500 Shield\r\n1 x Lithium Ion Battery - 3.7v 2000mAh\r\n4 x Pololu Carrier for MQ Gas Sensors\r\n1 x SparkFun Hydrogen Gas Sensor - MQ-8\r\n1 x 4.7K Ohm\r\n1 x Pololu Carbon Monoxide &amp; Flammable Gas Sensor - MQ-9\r\n1 x 22k Ohm\r\n1 x SparkFun Carbon Monoxide Gas Sensor - MQ-7\r\n1 x 10K Ohm\r\n1 x SparkFun Alcohol Gas Sensor - MQ-3\r\n1 x 220k Ohm\r\n1 x Temperature and Humidity Sensor - RHT03\r\n1 x PIR Motion Sensor (JST)\r\n1 x SparkFun Solderable Half-Breadboard\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 &lt;EEPROM.h&gt;\r\n\/\/ RHT Temperature and Humidity Sensor\r\n#include &lt;SparkFun_RHT03.h&gt;\r\n\/\/ Adafruit RGB LCD Shield 16x2\r\n#include &lt;Adafruit_RGBLCDShield.h&gt;\r\n\r\n\/\/ RHT Temperature and Humidity Sensor\r\n\/\/ RHT03 data pin Digital 5\r\nconst int RHT03_DATA_PIN = 5;\r\n\/\/ This creates a RTH03 object, which we&#039;ll use to interact with the sensor\r\nRHT03 rht;\r\nfloat latestHumidity;\r\nfloat latestTempC;\r\n\r\n\/\/ Gas Sensors MQ\r\n\/\/ Hydrogen Gas Sensor - MQ-8\r\nint iMQ8 = A0;\r\nint iMQ8Raw = 0;\r\nint iMQ8ppm = 0;\r\n\/\/ Two points are taken from the curve in datasheet.\r\n\/\/ With these two points, a line is formed which is\r\n\/\/ &quot;approximately equivalent&quot; to the original curve.\r\nfloat H2Curve[3] = {2.3, 0.93,-1.44};\r\n\r\n\/\/ Carbon Monoxide &amp; Flammable Gas Sensor - MQ-9\r\nint iMQ9 = A1;\r\nint iMQ9Raw = 0;\r\nint iMQ9ppm = 0;\r\n\r\n\/\/ Carbon Monoxide Gas Sensor - MQ-7\r\nint iMQ7 = A2;\r\nint iMQ7Raw = 0;\r\nint iMQ7ppm = 0;\r\n\r\n\/\/ Alcohol Gas Sensor - MQ-3\r\nint iMQ3 = A3;\r\nint iMQ3Raw = 0;\r\nint iMQ3ppm = 0;\r\n\r\n\/\/ PIR Motion\r\n\/\/ Motion detector\r\nconst int iMotion = 7;\r\n\/\/ Proximity\r\nint proximity = LOW;\r\nString Det = &quot;&quot;;\r\n\r\n\/\/ Adafruit RGB LCD Shield\r\nAdafruit_RGBLCDShield RGBLCDShield = Adafruit_RGBLCDShield();\r\n\/\/ These #defines make it easy to set the backlight color\r\n#define OFF 0x0\r\n#define RED 0x1\r\n#define YELLOW 0x3\r\n#define GREEN 0x2\r\n#define TEAL 0x6\r\n#define BLUE 0x4\r\n#define VIOLET 0x5\r\n#define WHITE 0x7\r\n\/\/ Momentary Button\r\nint yy = 0;\r\nuint8_t momentaryButton = 0;\r\n\r\n\/\/ Software Version Information\r\nString uid = &quot;&quot;;\r\n\/\/ Version\r\nString sver = &quot;15-15&quot;;\r\n\r\nvoid loop()\r\n{\r\n     \r\n  \/\/ Adafruit RGB LCD Shield\r\n  \/\/ Clear\r\n  RGBLCDShield.clear();\r\n  \r\n  \/\/ RHT Temperature and Humidity Sensor\r\n  isRHT03();\r\n\r\n  \/\/ Gas Sensors MQ\r\n  isGasSensor();\r\n\r\n  \/\/ isPIR Motion\r\n  isPIR();\r\n\r\n  \/\/ Adafruit RGB LCD Shield\r\n  \/\/ Display\r\n  isDisplay();\r\n\r\n  \/\/ Delay\r\n  \/\/ Turn the LED on HIGH is the voltage level\r\n  digitalWrite(LED_BUILTIN, HIGH);\r\n  \/\/ Wait for a 0.5 second\r\n  delay( 500 );\r\n  \/\/ Turn the LED off by making the voltage LOW\r\n  digitalWrite(LED_BUILTIN, LOW);\r\n  \/\/ Wait for a 0.5 second\r\n  delay( 500 );\r\n \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>getGasSensorMQ.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Gas Sensors MQ\r\n\/\/ Gas Sensor\r\nvoid isGasSensor() {\r\n\r\n  \/\/ Read in analog value from each gas sensors\r\n  \r\n  \/\/ Hydrogen Gas Sensor - MQ-8\r\n  iMQ8Raw = analogRead( iMQ8 );\r\n\r\n  \/\/ Carbon Monoxide &amp; Flammable Gas Sensor - MQ-9\r\n  iMQ9Raw = analogRead( iMQ9 );  \r\n\r\n  \/\/ Carbon Monoxide Gas Sensor - MQ-7\r\n  iMQ7Raw = analogRead( iMQ7 );\r\n\r\n  \/\/ Alcohol Gas Sensor - MQ-3\r\n  iMQ3Raw = analogRead( iMQ3 );\r\n  \r\n  \/\/ Caclulate the PPM of each gas sensors\r\n\r\n  \/\/ Hydrogen Gas Sensor - MQ-8\r\n  iMQ8ppm = isMQ8( iMQ8Raw );\r\n\r\n  \/\/ Carbon Monoxide &amp; Flammable Gas Sensor - MQ-9\r\n  iMQ9ppm = isMQ9( iMQ9Raw ); \r\n\r\n  \/\/ Carbon Monoxide Gas Sensor - MQ-7\r\n  iMQ7ppm = isMQ7( iMQ7Raw ); \r\n\r\n  \/\/ Alcohol Gas Sensor - MQ-3\r\n  iMQ3ppm = isMQ3( iMQ3Raw ); \r\n\r\n}\r\n\/\/ Hydrogen Gas Sensor - MQ-8 - PPM\r\nint isMQ8(double rawValue) {\r\n\r\n  \/\/ RvRo\r\n  double RvRo = rawValue * (3.3 \/ 1023);\r\n\r\n  return (pow(4.7,( ((log(RvRo)-H2Curve[1])\/H2Curve[2]) + H2Curve[0])));\r\n  \r\n}\r\n\/\/ Carbon Monoxide &amp; Flammable Gas Sensor - MQ-9\r\nint isMQ9(double rawValue) {\r\n\r\n  double RvRo = rawValue * 3.3 \/ 4095;\r\n\r\n  double ppm = 3.027*exp(1.0698*( RvRo ));\r\n  return ppm;\r\n  \r\n}\r\n\/\/ Carbon Monoxide Gas Sensor - MQ-7\r\nint isMQ7(double rawValue) {\r\n\r\n  double RvRo = rawValue * 3.3 \/ 4095;\r\n\r\n  double ppm = 3.027*exp(1.0698*( RvRo ));\r\n  return ppm;\r\n  \r\n}\r\n\/\/ Alcohol Gas Sensor - MQ-3\r\nint isMQ3(double rawValue) {\r\n\r\n  double RvRo = rawValue * 3.3 \/ 4095;\r\n\r\n  double bac = RvRo * 0.21;\r\n  return bac;\r\n  \r\n}\r\n<\/pre>\n<p><strong>getPIR.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ PIR Motion\r\n\/\/ Setup PIR\r\nvoid setupPIR() {\r\n\r\n  \/\/ Setup PIR Montion\r\n  pinMode(iMotion, INPUT_PULLUP);\r\n  \r\n}\r\n\/\/ isPIR Motion\r\nvoid isPIR() {\r\n\r\n  \/\/ Proximity\r\n  proximity = digitalRead(iMotion);\r\n  if (proximity == LOW) \r\n  {\r\n\r\n    \/\/ PIR Motion Sensor&#039;s LOW, Motion is detected\r\n    Det = &quot;Motion Yes&quot;;\r\n\r\n  }\r\n  else\r\n  {\r\n\r\n    \/\/ PIR Motion Sensor&#039;s HIGH\r\n    Det = &quot;No&quot;;\r\n    \r\n  }\r\n  \r\n}\r\n<\/pre>\n<p><strong>getRGBLCDShield.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ Adafruit RGB LCD Shield\r\n\/\/ Setup RGB LCD Shield\r\nvoid isSetupRGBLCDShield() {\r\n\r\n  \/\/ Adafruit RGB LCD Shield\r\n  \/\/ Set up the LCD&#039;s number of columns and rows: \r\n  RGBLCDShield.begin(16, 2);\r\n\r\n  \/\/ Set the cursor to column 0, line 0\r\n  RGBLCDShield.setBacklight(RED);\r\n  \/\/ Don luc \r\n  RGBLCDShield.setCursor(0,0);\r\n  RGBLCDShield.print(&quot;Don Luc&quot;);\r\n  \/\/ Set the cursor to column 0, line 1\r\n  RGBLCDShield.setCursor(0, 1);\r\n  \/\/ Electronics\r\n  RGBLCDShield.print(&quot;Electronics&quot;);\r\n  \/\/ Delay\r\n  delay(5000);\r\n  \/\/ Clear\r\n  RGBLCDShield.clear();\r\n\r\n  \/\/ Set the cursor to column 0, line 0\r\n  RGBLCDShield.setBacklight(TEAL);\r\n  \/\/ Version \r\n  RGBLCDShield.setCursor(0,0);\r\n  RGBLCDShield.print(&quot;Version: &quot; + sver);\r\n  \/\/ Set the cursor to column 0, line 1\r\n  RGBLCDShield.setCursor(0, 1);\r\n  \/\/ Unit ID\r\n  RGBLCDShield.print(&quot;Unit ID: &quot; + uid);\r\n  \/\/ Delay\r\n  delay(5000);\r\n  \/\/ Clear\r\n  RGBLCDShield.clear();\r\n  \r\n}\r\n\/\/ isDisplay\r\nvoid isDisplay() {\r\n\r\n  \/\/ Momentary Button\r\n  momentaryButton = RGBLCDShield.readButtons();\r\n\r\n  switch ( yy ) {\r\n    case 1:\r\n    \r\n      \/\/ RHT Temperature and Humidity Sensor\r\n      \/\/ Set the cursor to column 0, line 0\r\n      RGBLCDShield.setCursor(0,0);\r\n      \/\/ Temperature C\r\n      RGBLCDShield.print( &quot;Temp C: &quot; );\r\n      RGBLCDShield.print( latestTempC );\r\n      \/\/ Set the cursor to column 0, line 1\r\n      RGBLCDShield.setCursor(0, 1);\r\n      \/\/ Humidity\r\n      RGBLCDShield.print( &quot;Humidity: &quot; );\r\n      RGBLCDShield.print( latestHumidity );\r\n\r\n      break;\r\n    case 2:\r\n    \r\n      \/\/ PIR Motion Sensor\r\n      \/\/ Set the cursor to column 0, line 0\r\n      \/\/ PIR Motion Sensor\r\n      RGBLCDShield.setCursor(0,0);\r\n      RGBLCDShield.print( &quot;PIR Motion&quot; );\r\n      \/\/ Set the cursor to column 0, line 1\r\n      RGBLCDShield.setCursor(0, 1);\r\n      \/\/ Det\r\n      RGBLCDShield.print( Det );\r\n      \r\n      break;\r\n    case 3:\r\n\r\n      \/\/ Gas Sensors 1\r\n      \/\/ Set the cursor to column 0, line 0\r\n      RGBLCDShield.setCursor(0,0);\r\n      \/\/ Hydrogen Gas Sensor - MQ-8\r\n      RGBLCDShield.print( &quot;MQ-8: &quot; );\r\n      RGBLCDShield.print( iMQ8ppm );\r\n      \/\/ Set the cursor to column 0, line 1\r\n      RGBLCDShield.setCursor(0, 1);\r\n      \/\/ Carbon Monoxide &amp; Flammable Gas Sensor - MQ-9\r\n      RGBLCDShield.print( &quot;MQ-9: &quot; );\r\n      RGBLCDShield.print( iMQ9ppm );\r\n      \r\n      break;\r\n    case 4:\r\n\r\n      \/\/ Gas Sensors 2\r\n      \/\/ Set the cursor to column 0, line 0\r\n      RGBLCDShield.setCursor(0,0);\r\n      \/\/ Carbon Monoxide Gas Sensor - MQ-7\r\n      RGBLCDShield.print( &quot;MQ-7: &quot; );\r\n      RGBLCDShield.print( iMQ7ppm );\r\n      \/\/ Set the cursor to column 0, line 1\r\n      RGBLCDShield.setCursor(0, 1);\r\n      \/\/ Alcohol Gas Sensor - MQ-3\r\n      RGBLCDShield.print( &quot;MQ-3: &quot; );\r\n      RGBLCDShield.print( iMQ3ppm );\r\n      \r\n      break;\r\n    case 5:\r\n\r\n      \/\/ Don luc Electronics\r\n      \/\/ Set the cursor to column 0, line 0\r\n      \/\/ Don luc \r\n      RGBLCDShield.setCursor(0,0);\r\n      RGBLCDShield.print(&quot;Don Luc&quot;);\r\n      \/\/ Set the cursor to column 0, line 1\r\n      RGBLCDShield.setCursor(0, 1);\r\n      \/\/ Electronics\r\n      RGBLCDShield.print(&quot;Electronics&quot;);\r\n      \r\n      break;\r\n    default:\r\n\r\n      \/\/ Don luc Electronics\r\n      yy = 5;\r\n      RGBLCDShield.setBacklight(RED);\r\n      \/\/ Set the cursor to column 0, line 0\r\n      \/\/ Don luc \r\n      RGBLCDShield.setCursor(0,0);\r\n      RGBLCDShield.print(&quot;Don Luc&quot;);\r\n      \/\/ Set the cursor to column 0, line 1\r\n      RGBLCDShield.setCursor(0, 1);\r\n      \/\/ Electronics\r\n      RGBLCDShield.print(&quot;Electronics&quot;);\r\n\r\n   }\r\n   \r\n   if ( momentaryButton ) {\r\n    \r\n    if ( momentaryButton &amp; BUTTON_UP ) {\r\n      \r\n      yy = 1;\r\n      \/\/ RHT Temperature and Humidity Sensor\r\n      RGBLCDShield.setBacklight(GREEN);\r\n      \r\n    }\r\n    \r\n    if ( momentaryButton &amp; BUTTON_DOWN ) {\r\n      \r\n      yy = 2;\r\n      \/\/ PIR Motion Sensor\r\n      RGBLCDShield.setBacklight(VIOLET);\r\n      \r\n    }\r\n    \r\n    if ( momentaryButton &amp; BUTTON_LEFT ) {\r\n      \r\n      yy = 3;\r\n      \/\/ Gas Sensors 1\r\n      RGBLCDShield.setBacklight(TEAL);\r\n      \r\n    }\r\n    \r\n    if ( momentaryButton &amp; BUTTON_RIGHT ) {\r\n\r\n      yy = 4;\r\n      \/\/ Gas Sensors 2\r\n      RGBLCDShield.setBacklight(YELLOW);\r\n    }\r\n    \r\n    if ( momentaryButton &amp; BUTTON_SELECT ) {\r\n\r\n      yy = 5;\r\n      \/\/ Don luc Electronics\r\n      RGBLCDShield.setBacklight(RED);\r\n   \r\n    }\r\n    \r\n  }\r\n  \r\n}\r\n<\/pre>\n<p><strong>getRHT.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"arduino\" data-enlighter-title=\"\">\r\n\/\/ RHT Temperature and Humidity Sensor\r\n\/\/ setup RHT Temperature and Humidity Sensor\r\nvoid setupRTH03() {\r\n\r\n  \/\/ RHT Temperature and Humidity Sensor\r\n  \/\/ Call rht.begin() to initialize the sensor and our data pin\r\n  rht.begin(RHT03_DATA_PIN);\r\n  \r\n}\r\n\/\/ RHT Temperature and Humidity Sensor\r\nvoid isRHT03(){\r\n\r\n  \/\/ Call rht.update() to get new humidity and temperature values from the sensor.\r\n  int updateRet = rht.update();\r\n\r\n  \/\/ The humidity(), tempC(), and tempF() functions can be called -- after \r\n  \/\/ a successful update() -- to get the last humidity and temperature value \r\n  latestHumidity = rht.humidity();\r\n  latestTempC = rht.tempC();\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 Unique ID\r\n  isUID();\r\n  \r\n  \/\/ RHT Temperature and Humidity Sensor\r\n  \/\/ Setup RTH03 Temperature and Humidity Sensor\r\n  setupRTH03();\r\n\r\n  \/\/ PIR Motion\r\n  \/\/ Setup PIR\r\n  setupPIR();\r\n\r\n  \/\/ Initialize digital pin LED_BUILTIN as an output.\r\n  pinMode(LED_BUILTIN, OUTPUT);\r\n\r\n  \/\/ Adafruit RGB LCD Shield\r\n  isSetupRGBLCDShield();\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>Camera and Video Capture Receiver Stationary, Wheel\/Tank and Underwater Vehicle<\/li>\n<li>Unmanned Vehicles Terrestrial and Marine<\/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 and E-Mentor<\/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\/luc\/<\/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;&#8212; #DonLucElectronics #DonLuc #Environment #MQ #PIR #RHT03 #ArduinoUNO #Arduino #AdafruitPowerBoost #Project #Programming #Electronics #Microcontrollers #Consultant #VideoBlog &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; &#8212;&#8212; RGB LCD Shield 16&#215;2 Character Negative Display With this in mind, we wanted to make it easier for people to get these LCD into their projects so we devised a shield that lets you &#8230; <a title=\"Project #15: Environment \u2013 RGB LCD Shield 16&#215;2 Character Display \u2013 Mk15\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=2880\" aria-label=\"Read more about Project #15: Environment \u2013 RGB LCD Shield 16&#215;2 Character Display \u2013 Mk15\">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,38,59,5,46,58,10,43],"tags":[86,6,92,102,4,87,19,107,85,24,103,9,27,180,88,109,33,34],"class_list":["post-2880","post","type-post","status-publish","format-standard","hentry","category-environment","category-adafruit","category-arduino","category-consultant","category-digitalelectronics","category-fritzing","category-microcontrollers","category-pololu","category-arduino-programming","category-projects","category-sparkfun","tag-adafruit","tag-arduino","tag-battery","tag-components","tag-consultant","tag-display","tag-electronics","tag-environment","tag-fritzing","tag-microcontroller","tag-pololu","tag-programming","tag-projects-2","tag-rgb-lcd-shield-16x2-character-display","tag-rht03-humidity-and-temperature-sensor","tag-sparkfun","tag-technology","tag-video-blog"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2880","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=2880"}],"version-history":[{"count":1,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2880\/revisions"}],"predecessor-version":[{"id":2886,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/2880\/revisions\/2886"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2880"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2880"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2880"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}