{"id":1745,"date":"2018-08-09T09:26:58","date_gmt":"2018-08-09T16:26:58","guid":{"rendered":"http:\/\/www.donluc.com\/?p=1745"},"modified":"2018-08-09T09:26:58","modified_gmt":"2018-08-09T16:26:58","slug":"project-7-rgb-lcd-shield-bi-color-led-mk09","status":"publish","type":"post","link":"https:\/\/www.donluc.com\/?p=1745","title":{"rendered":"Project #7: RGB LCD Shield \u2013 Bi-Color LED  \u2013 Mk09"},"content":{"rendered":"<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02a.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02a.png\" alt=\"\" width=\"720\" height=\"683\" class=\"alignnone size-full wp-image-1746\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02a.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02a-300x285.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02b.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02b.png\" alt=\"\" width=\"720\" height=\"683\" class=\"alignnone size-full wp-image-1747\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02b.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02b-300x285.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02c.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02c.png\" alt=\"\" width=\"720\" height=\"540\" class=\"alignnone size-full wp-image-1748\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02c.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02c-300x225.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02d.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02d.png\" alt=\"\" width=\"720\" height=\"540\" class=\"alignnone size-full wp-image-1749\" srcset=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02d.png 720w, https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02d-300x225.png 300w\" sizes=\"auto, (max-width: 720px) 100vw, 720px\" \/><\/a><\/p>\n<div style=\"width: 720px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-1745-1\" width=\"720\" height=\"406\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02.mp4?_=1\" \/><a href=\"https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02.mp4\">https:\/\/www.donluc.com\/wp-content\/uploads\/2018\/08\/DonLuc1808Mk02.mp4<\/a><\/video><\/div>\n<p><strong>Bi-Color LED<\/strong><\/p>\n<p>Bi-color LEDs contain two different LED emitters in one case. There are two types of these. One type consists of two dies connected to the same two leads antiparallel to each other. Current flow in one direction emits one color, and current in the opposite direction emits the other color. The other type consists of two dies with separate leads for both dies and another lead for common anode or cathode so that they can be controlled independently. The most common bi-color combination is red\/traditional green, however, other available combinations include amber\/traditional green, red\/pure green, red\/blue, and blue\/pure green.<\/p>\n<p><strong>Super Bright BiPolar LEDs<\/strong><\/p>\n<p>Package of 12 super bright Red\/Green jumbo T1 3\/4 5mm LEDs. These have a diffused frosted lens and 3 long leads. Prime 100% perfect and bright. CODE 7: 100% Prime Parts. Stock # GP55 <\/p>\n<p><strong>DonLuc1808Mk02<\/strong><\/p>\n<p>1 x RGB LCD Shield 16&#215;2 Character Display<br \/>\n1 x Arduino UNO &#8211; R3<br \/>\n1 x ProtoScrewShield<br \/>\n3 x Bi-Color LED GP55<br \/>\n3 x 270 Ohm Resistance<br \/>\n3 x 330 Ohm Resistance<br \/>\n3 x Jumper Wires 3&#8243; M\/M<br \/>\n7 x Jumper Wires 6&#8243; M\/M<br \/>\n1 x Size Breadboard<br \/>\n1 x USB Cable A to B<\/p>\n<p><strong>Arduino UNO<\/strong><\/p>\n<p>LG3 &#8211; Digital 5<br \/>\nLR3 &#8211; Digital 4<br \/>\nLG2 &#8211; Digital 3<br \/>\nLR2 &#8211; Digital 2<br \/>\nLG1 &#8211; Digital 1<br \/>\nLR1 &#8211; Digital 0<br \/>\nGND &#8211; GND<\/p>\n<p><strong>DonLuc1808Mk02p.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"DonLuc1808Mk02p.ino\">\r\n\/\/ ***** Don Luc *****\r\n\/\/ Software Version Information\r\n\/\/ Project #7: RGB LCD Shield \u2013 Bi-Color LED  \u2013 Mk09\r\n\/\/ 8-02\r\n\/\/ DonLuc1808Mk02p 8-02\r\n\/\/ RGB LCD Shield\r\n\/\/ Bi-Color LED\r\n\r\n\/\/ Include Library Code\r\n#include &lt;Adafruit_MCP23017.h&gt;\r\n#include &lt;Adafruit_RGBLCDShield.h&gt;\r\n\r\n\/\/ RGB LCD Shield\r\nAdafruit_RGBLCDShield RGBLCDShield = Adafruit_RGBLCDShield();\r\n#define GREEN 0x2\r\n\r\n\/\/ Bi-Color LED\r\nint iLR1 = 0;      \/\/ LED Red 1\r\nint iLG1 = 1;      \/\/ LED Green 1\r\nint iLR2 = 2;      \/\/ LED Red 2\r\nint iLG2 = 3;      \/\/ LED Green 2\r\nint iLR3 = 4;      \/\/ LED Red 3\r\nint iLG3 = 5;      \/\/ LED Green 3\r\n\r\nvoid loop() \r\n{\r\n\r\n  \/\/ Bi-Color LED\r\n  isBiColor();\r\n\r\n  delay(1000);\r\n  \r\n  \/\/ Clear\r\n  RGBLCDShield.clear();\r\n  \r\n}\r\n<\/pre>\n<p><strong>getBiColor.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"getBiColor.ino\">\r\n\/\/ Bi-Color LED\r\nvoid isBiColor()\r\n{\r\n   \r\n  \/\/ Display\r\n  \/\/ Set the cursor to column 0, line 0  \r\n  RGBLCDShield.setCursor(0,0);\r\n  RGBLCDShield.print(&quot;Bi-Color LED&quot;);         \/\/ Bi-Color LED\r\n\r\n  \/\/ Bi-Color LED\r\n   \r\n  \/\/ Set the cursor to column 0, line 1\r\n  RGBLCDShield.setCursor(0, 1); \r\n  RGBLCDShield.print(&quot;L1x- L2x- L3x-&quot;);      \/\/ Bi-Color LED Red\r\n\r\n  digitalWrite(iLR1, HIGH);                  \/\/ LED Red 1\r\n  digitalWrite(iLG1, LOW);                   \/\/ LED Green 1\r\n  digitalWrite(iLR2, HIGH);                  \/\/ LED Red 2\r\n  digitalWrite(iLG2, LOW);                   \/\/ LED Green 2\r\n  digitalWrite(iLR3, HIGH);                  \/\/ LED Red 3\r\n  digitalWrite(iLG3, LOW);                   \/\/ LED Green 3\r\n\r\n  delay( 2000 );\r\n\r\n  \/\/ Set the cursor to column 0, line 1\r\n  RGBLCDShield.setCursor(0, 1); \r\n  RGBLCDShield.print(&quot;L1-x L2-x L3-x&quot;);      \/\/ Bi-Color LED Green\r\n\r\n  digitalWrite(iLR1, LOW);                   \/\/ LED Red 1\r\n  digitalWrite(iLG1, HIGH);                  \/\/ LED Green 1\r\n  digitalWrite(iLR2, LOW);                   \/\/ LED Red 2\r\n  digitalWrite(iLG2, HIGH);                  \/\/ LED Green 2  \r\n  digitalWrite(iLR3, LOW);                   \/\/ LED Red 3\r\n  digitalWrite(iLG3, HIGH);                  \/\/ LED Green 3\r\n\r\n  delay( 2000 );\r\n\r\n  \/\/ Set the cursor to column 0, line 1\r\n  RGBLCDShield.setCursor(0, 1); \r\n  RGBLCDShield.print(&quot;L1xx L2xx L3xx&quot;);      \/\/ Bi-Color LED Red-Green\r\n\r\n  digitalWrite(iLR1, HIGH);                  \/\/ LED Red 1\r\n  digitalWrite(iLG1, HIGH);                  \/\/ LED Green 1\r\n  digitalWrite(iLR2, HIGH);                  \/\/ LED Red 2\r\n  digitalWrite(iLG2, HIGH);                  \/\/ LED Green 2  \r\n  digitalWrite(iLR3, HIGH);                  \/\/ LED Red 3\r\n  digitalWrite(iLG3, HIGH);                  \/\/ LED Green 3\r\n\r\n  delay( 2000 ); \r\n  \r\n}\r\n<\/pre>\n<p><strong>setup.ino<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"default\" data-enlighter-title=\"setup.ino\">\r\n\/\/ Setup\r\nvoid setup() \r\n{\r\n\r\n  \/\/ set up the LCD&#039;s number of columns and rows: \r\n  RGBLCDShield.begin(16, 2);\r\n  RGBLCDShield.setBacklight(GREEN);\r\n  \r\n  \/\/ Display\r\n  \/\/ Set the cursor to column 0, line 0  \r\n  RGBLCDShield.setCursor(0,0);  \r\n  RGBLCDShield.print(&quot;Don Luc&quot;);           \/\/ Don luc\r\n  \/\/ Set the cursor to column 0, line 1\r\n  RGBLCDShield.setCursor(0, 1);\r\n  RGBLCDShield.print(&quot;Bi-Color LED&quot;);      \/\/ Bi-Color LED\r\n  delay(5000);\r\n\r\n  \/\/ Clear\r\n  RGBLCDShield.clear();\r\n\r\n  \/\/ Bi-Color LED\r\n  pinMode(iLR1, OUTPUT);                   \/\/ LED Red 1\r\n  pinMode(iLG1, OUTPUT);                   \/\/ LED Green 1\r\n  pinMode(iLR2, OUTPUT);                   \/\/ LED Red 2\r\n  pinMode(iLG2, OUTPUT);                   \/\/ LED Green 2\r\n  pinMode(iLR3, OUTPUT);                   \/\/ LED Red 3\r\n  pinMode(iLG3, OUTPUT);                   \/\/ LED Green 3\r\n  \r\n}\r\n<\/pre>\n<p><strong>Don Luc<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bi-Color LED Bi-color LEDs contain two different LED emitters in one case. There are two types of these. One type consists of two dies connected to the same two leads antiparallel to each other. Current flow in one direction emits one color, and current in the opposite direction emits the other color. The other type &#8230; <a title=\"Project #7: RGB LCD Shield \u2013 Bi-Color LED  \u2013 Mk09\" class=\"read-more\" href=\"https:\/\/www.donluc.com\/?p=1745\" aria-label=\"Read more about Project #7: RGB LCD Shield \u2013 Bi-Color LED  \u2013 Mk09\">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":[71,47,50,38,74,59,5,58,10],"tags":[],"class_list":["post-1745","post","type-post","status-publish","format-standard","hentry","category-rgb-lcd-shield","category-adafruit","category-arduino","category-digitalelectronics","category-electronic-goldmine","category-fritzing","category-microcontrollers","category-arduino-programming","category-projects"],"_links":{"self":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/1745","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=1745"}],"version-history":[{"count":1,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/1745\/revisions"}],"predecessor-version":[{"id":1751,"href":"https:\/\/www.donluc.com\/index.php?rest_route=\/wp\/v2\/posts\/1745\/revisions\/1751"}],"wp:attachment":[{"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.donluc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}