{"id":747,"date":"2021-06-26T11:11:26","date_gmt":"2021-06-26T11:11:26","guid":{"rendered":"https:\/\/mc.scsiraidguru.com\/?page_id=747"},"modified":"2024-03-06T16:10:08","modified_gmt":"2024-03-06T16:10:08","slug":"ard_rgb_led","status":"publish","type":"page","link":"https:\/\/mc.scsiraidguru.com\/index.php\/arduino\/diode\/ard_light_emitting\/ard_rgb_led\/","title":{"rendered":"Ard_RGB_LED"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"747\" class=\"elementor elementor-747\" data-elementor-post-type=\"page\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-42a2422 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"42a2422\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-948133e\" data-id=\"948133e\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-58f0d54 elementor-widget elementor-widget-image\" data-id=\"58f0d54\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:auto\/h:auto\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/06\/7-segment-LED-with-SN74HC595.jpg\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"7-segment-LED-with-SN74HC595\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6Nzg4LCJ1cmwiOiJodHRwczpcL1wvbWMuc2NzaXJhaWRndXJ1LmNvbVwvd3AtY29udGVudFwvdXBsb2Fkc1wvMjAyMVwvMDZcLzctc2VnbWVudC1MRUQtd2l0aC1TTjc0SEM1OTUuanBnIn0%3D\">\n\t\t\t\t\t\t\t<img data-opt-id=1643448800  fetchpriority=\"high\" decoding=\"async\" width=\"300\" height=\"289\" src=\"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:289\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/06\/7-segment-LED-with-SN74HC595.jpg\" class=\"attachment-medium size-medium wp-image-788\" alt=\"\" srcset=\"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:847\/h:816\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/06\/7-segment-LED-with-SN74HC595.jpg 847w, https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:289\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/06\/7-segment-LED-with-SN74HC595.jpg 300w, https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:768\/h:740\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/06\/7-segment-LED-with-SN74HC595.jpg 768w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-64152d8 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"64152d8\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b10e145\" data-id=\"b10e145\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8e0ef13 elementor-widget elementor-widget-text-editor\" data-id=\"8e0ef13\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p><span style=\"color: #000000;\">I have been reading Jeremy Blum&#8217;s Exploring Arduino.\u00a0\u00a0 I had a RGB LED in the box.\u00a0\u00a0 So I decided to try his code out.\u00a0\u00a0 The only difference was the type.\u00a0 It was a cathode RGB LED.\u00a0 To get it to work, I had to take it to the ground instead of 5V.\u00a0\u00a0\u00a0 I connected it to the 4th Slave with the 7 segment LED on pins 10,11 and 13.\u00a0 I have cleanup work to do on the code.\u00a0 <\/span><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-127b7f5 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"127b7f5\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-275a17d\" data-id=\"275a17d\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-02eeb3b elementor-widget elementor-widget-text-editor\" data-id=\"02eeb3b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<pre>\/*<br \/>Exploring Arduino - Code Listing 2-6: Toggling LED Nightlight<br \/>http:\/\/www.exploringarduino.com\/content\/ch2<br \/>Copyright 2013 Jeremy Blum ( http:\/\/www.jeremyblum.com )<br \/>This program is free software: you can redistribute it and\/or modify<br \/>it under the terms of the GNU General Public License v3 as published by<br \/>the Free Software Foundation.<br \/>*\/<br \/><br \/>const int BLED=3; \/\/Blue LED on Pin 9<br \/>const int GLED=5; \/\/Green LED on Pin 10<br \/>const int RLED=6; \/\/Red LED on Pin 11<br \/>const int BUTTON=2; \/\/The Button is connected to pin 2<br \/><br \/>boolean lastButton = LOW; \/\/Last Button State<br \/>boolean currentButton = LOW; \/\/Current Button State<br \/>int ledMode = 0; \/\/Cycle between LED states<br \/><br \/>#include<br \/>int LED = 13;<br \/><br \/>\/\/ 8 segment LED for x counter<br \/>int latchPin_7Segment=11; \/\/white 595 pin 12<br \/>int clockPin_8Segment=9; \/\/blue 595 pin 11<br \/>int dataPin_8Segment=12; \/\/black 595 pin 14<br \/>\/\/ 8 segment LED for x counter<br \/><br \/>\/\/ i2c counter<br \/>int x = 0;<br \/>int dt=250;<br \/>\/\/ i2c counter<br \/><br \/>\/\/ 8 segment LED for x counter<br \/>byte LEDsOff=0b00000000;<br \/>byte LEDsOn=0b11111111;<br \/>byte LEDs1=0b10000000;<br \/>byte LEDs2=0b01000000;<br \/>byte LEDs3=0b00100000;<br \/>byte LEDs4=0b00010000;<br \/>byte LEDs5=0b00001000;<br \/>byte LEDs6=0b00000100;<br \/>byte LEDs7=0b00000010;<br \/>byte LEDs8=0b00000001;<br \/><br \/>byte LEDZero = 0b11111100;<br \/>byte LEDOne = 0b01100000;<br \/>byte LEDTwo = 0b11011010;<br \/>byte LEDThree = 0b11110010;<br \/>byte LEDFour = 0b01100110;<br \/>byte LEDFive = 0b10110110;<br \/>byte LEDSix = 0b00111110;<br \/>\/\/ 8 segment LED for x counter<br \/><br \/>void setup() {<br \/><br \/>pinMode (BLED, OUTPUT); \/\/Set Blue LED as Output<br \/>pinMode (GLED, OUTPUT); \/\/Set Green LED as Output<br \/>pinMode (RLED, OUTPUT); \/\/Set Red LED as Output<br \/>pinMode (BUTTON, INPUT); \/\/Set button as input (not required)<br \/><br \/>pinMode (LED, OUTPUT);<br \/>pinMode (latchPin_7Segment,OUTPUT);<br \/>pinMode (dataPin_8Segment,OUTPUT);<br \/>pinMode (clockPin_8Segment,OUTPUT);<br \/><br \/>\/\/ Start the I2C Bus as Slave on address 4<br \/>Wire.begin(4);<br \/>\/\/ Attach a function to trigger when something is received.<br \/>Wire.onReceive(receiveEvent);<br \/>}<br \/><br \/>\/*<br \/>* LED Mode Selection<br \/>* Pass a number for the LED state and set it accordingly<br \/>*\/<br \/>void setMode(int mode)<br \/>{<br \/>\/\/RED<br \/>if (mode == 1)<br \/>{<br \/>digitalWrite(RLED, HIGH);<br \/>digitalWrite(GLED, LOW);<br \/>digitalWrite(BLED, LOW);<br \/>}<br \/>\/\/GREEN<br \/>else if (mode == 2)<br \/>{<br \/>digitalWrite(RLED, LOW);<br \/>digitalWrite(GLED, HIGH);<br \/>digitalWrite(BLED, LOW);<br \/>}<br \/>\/\/BLUE<br \/>else if (mode == 3)<br \/>{<br \/>digitalWrite(RLED, LOW);<br \/>digitalWrite(GLED, LOW);<br \/>digitalWrite(BLED, HIGH);<br \/>}<br \/>\/\/PURPLE (RED+BLUE)<br \/>else if (mode == 4)<br \/>{<br \/>analogWrite(RLED, 127);<br \/>analogWrite(GLED, 0);<br \/>analogWrite(BLED, 127);<br \/>}<br \/>\/\/TEAL (BLUE+GREEN)<br \/>else if (mode == 5)<br \/>{<br \/>analogWrite(RLED, 0);<br \/>analogWrite(GLED, 127);<br \/>analogWrite(BLED, 127);<br \/>}<br \/>\/\/ORANGE (GREEN+RED)<br \/>else if (mode == 6)<br \/>{<br \/>analogWrite(RLED, 127);<br \/>analogWrite(GLED, 127);<br \/>analogWrite(BLED, 0);<br \/>}<br \/>\/\/WHITE (GREEN+RED+BLUE)<br \/>else if (mode == 7)<br \/>{<br \/>analogWrite(RLED, 85);<br \/>analogWrite(GLED, 85);<br \/>analogWrite(BLED, 85);<br \/>}<br \/>\/\/OFF (mode = 0)<br \/>else<br \/>{<br \/>digitalWrite(RLED, LOW);<br \/>digitalWrite(GLED, LOW);<br \/>digitalWrite(BLED, LOW);<br \/>}<br \/>}<br \/><br \/>\/*<br \/>* Debouncing Function<br \/>* Pass it the previous button state,<br \/>* and get back the current debounced button state.<br \/>*\/<br \/>boolean debounce(boolean last)<br \/>{<br \/>boolean current = digitalRead(BUTTON); \/\/Read the button state<br \/>if (last != current) \/\/if it's different...<br \/>{<br \/>delay(5); \/\/wait 5ms<br \/>current = digitalRead(BUTTON); \/\/read it again<br \/>}<br \/>return current; \/\/return the current value<br \/>}<br \/><br \/>void receiveEvent(int bytes) {<br \/>x = Wire.read(); \/\/ read one character from the I2C<br \/>}<br \/>\/\/ i2c counter<br \/><br \/>void loop() {<br \/><br \/>currentButton = debounce(lastButton); \/\/read debounced state<br \/>if (lastButton == LOW &amp;&amp; currentButton == HIGH) \/\/if it was pressed...<br \/>{<br \/>ledMode++; \/\/increment the LED value<br \/>}<br \/>lastButton = currentButton; \/\/reset button value<br \/>\/\/if you\u2019ve cycled through the different options, reset the counter to 0<br \/>if (ledMode == 8) ledMode = 0;<br \/>setMode(ledMode);<br \/><br \/>\/*<br \/>\/\/ test all LED display<br \/>digitalWrite(latchPin_7Segment,LOW);<br \/>shiftOut(dataPin_8Segment,clockPin_8Segment,LSBFIRST,LEDsOn);<br \/>digitalWrite(latchPin_7Segment,HIGH);<br \/>delay(dt);<br \/>*\/<br \/><br \/>\/\/ i2c counter<br \/>if (x == 1) {<br \/>\/\/LED display<br \/>digitalWrite(latchPin_7Segment,LOW);<br \/>shiftOut(dataPin_8Segment,clockPin_8Segment,LSBFIRST,LEDOne);<br \/>digitalWrite(latchPin_7Segment,HIGH);<br \/>}<br \/><br \/>if (x == 2) {<br \/><br \/>digitalWrite(latchPin_7Segment,LOW);<br \/>shiftOut(dataPin_8Segment,clockPin_8Segment,LSBFIRST,LEDTwo);<br \/>digitalWrite(latchPin_7Segment,HIGH);<br \/>}<br \/><br \/>if (x == 3) {<br \/><br \/>\/\/LED display<br \/>digitalWrite(latchPin_7Segment,LOW);<br \/>shiftOut(dataPin_8Segment,clockPin_8Segment,LSBFIRST,LEDThree);<br \/>digitalWrite(latchPin_7Segment,HIGH);<br \/>}<br \/><br \/>if (x == 4) {<br \/><br \/>digitalWrite(latchPin_7Segment,LOW);<br \/>shiftOut(dataPin_8Segment,clockPin_8Segment,LSBFIRST,LEDFour);<br \/>digitalWrite(latchPin_7Segment,HIGH);<br \/>}<br \/><br \/>if (x == 5) {<br \/>digitalWrite(LED, HIGH);<br \/>\/\/LED display<br \/>digitalWrite(latchPin_7Segment,LOW);<br \/>shiftOut(dataPin_8Segment,clockPin_8Segment,LSBFIRST,LEDFive);<br \/>digitalWrite(latchPin_7Segment,HIGH);<br \/>}<br \/>else {<br \/>digitalWrite(LED, LOW);<br \/>}<br \/><br \/>if (x == 6) {<br \/>digitalWrite(LED, HIGH);<br \/>\/\/ i2c counter<br \/><br \/>\/\/ 8 segment LED for x counter<br \/>digitalWrite(latchPin_7Segment,LOW);<br \/>shiftOut(dataPin_8Segment,clockPin_8Segment,LSBFIRST,LEDSix);<br \/>digitalWrite(latchPin_7Segment,HIGH);<br \/>}<br \/><br \/>\/*<br \/>\/\/test rgb<br \/>digitalWrite(RLED, LOW); <br \/>delay(100); <br \/>digitalWrite(RLED, HIGH); <br \/>delay(200);<br \/><br \/>digitalWrite(GLED, LOW); <br \/>delay(100); <br \/>digitalWrite(GLED, HIGH); <br \/>delay(200);<br \/><br \/>digitalWrite(BLED, LOW);<br \/>delay(100); <br \/>digitalWrite(BLED, HIGH);<br \/>delay(200); <br \/>*\/<br \/><br \/>}<\/pre>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>I have been reading Jeremy Blum&#8217;s Exploring Arduino.\u00a0\u00a0 I had a RGB LED in the box.\u00a0\u00a0 So I decided to try his code out.\u00a0\u00a0 The only difference was the type.\u00a0 It was a cathode RGB LED.\u00a0 To get it to work, I had to take it to the ground instead of 5V.\u00a0\u00a0\u00a0 I connected it [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":709,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"0","ocean_second_sidebar":"0","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"custom","ocean_center_header_left_menu":"0","ocean_custom_header_template":"7190","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"0","ocean_menu_typo_font_family":"0","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"0","osh_disable_topbar_sticky":"default","osh_disable_header_sticky":"default","osh_sticky_header_style":"default","osh_sticky_header_effect":"","osh_custom_sticky_logo":0,"osh_custom_retina_sticky_logo":0,"osh_custom_sticky_logo_height":0,"osh_background_color":"","osh_links_color":"","osh_links_hover_color":"","osh_links_active_color":"","osh_links_bg_color":"","osh_links_hover_bg_color":"","osh_links_active_bg_color":"","osh_menu_social_links_color":"","osh_menu_social_hover_links_color":"","footnotes":""},"class_list":["post-747","page","type-page","status-publish","hentry","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Ard_RGB_LED -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/mc.scsiraidguru.com\/index.php\/arduino\/diode\/ard_light_emitting\/ard_rgb_led\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Ard_RGB_LED -\" \/>\n<meta property=\"og:description\" content=\"I have been reading Jeremy Blum&#8217;s Exploring Arduino.\u00a0\u00a0 I had a RGB LED in the box.\u00a0\u00a0 So I decided to try his code out.\u00a0\u00a0 The only difference was the type.\u00a0 It was a cathode RGB LED.\u00a0 To get it to work, I had to take it to the ground instead of 5V.\u00a0\u00a0\u00a0 I connected it [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mc.scsiraidguru.com\/index.php\/arduino\/diode\/ard_light_emitting\/ard_rgb_led\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-06T16:10:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:289\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/06\/7-segment-LED-with-SN74HC595.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/arduino\\\/diode\\\/ard_light_emitting\\\/ard_rgb_led\\\/\",\"url\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/arduino\\\/diode\\\/ard_light_emitting\\\/ard_rgb_led\\\/\",\"name\":\"Ard_RGB_LED -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/arduino\\\/diode\\\/ard_light_emitting\\\/ard_rgb_led\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/arduino\\\/diode\\\/ard_light_emitting\\\/ard_rgb_led\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\/\\/mc.scsiraidguru.com\\/wp-content\\/uploads\\/2021\\/06\\/7-segment-LED-with-SN74HC595-300x289.jpg\",\"datePublished\":\"2021-06-26T11:11:26+00:00\",\"dateModified\":\"2024-03-06T16:10:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/arduino\\\/diode\\\/ard_light_emitting\\\/ard_rgb_led\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/arduino\\\/diode\\\/ard_light_emitting\\\/ard_rgb_led\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/arduino\\\/diode\\\/ard_light_emitting\\\/ard_rgb_led\\\/#primaryimage\",\"url\":\"https:\\/\\/mc.scsiraidguru.com\\/wp-content\\/uploads\\/2021\\/06\\/7-segment-LED-with-SN74HC595.jpg\",\"contentUrl\":\"https:\\/\\/mc.scsiraidguru.com\\/wp-content\\/uploads\\/2021\\/06\\/7-segment-LED-with-SN74HC595.jpg\",\"width\":847,\"height\":816},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/arduino\\\/diode\\\/ard_light_emitting\\\/ard_rgb_led\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Arduino\",\"item\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/arduino\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"ard_diode\",\"item\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/arduino\\\/diode\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Ard_Light_Emitting\",\"item\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/arduino\\\/diode\\\/ard_light_emitting\\\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Ard_RGB_LED\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/#website\",\"url\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/\",\"name\":\"SCSIraidGURU MC World\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/#\\\/schema\\\/person\\\/f21e3238456a7c2adea5944cb376cddc\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/#\\\/schema\\\/person\\\/f21e3238456a7c2adea5944cb376cddc\",\"name\":\"Michael McKenney\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\/\\/mc.scsiraidguru.com\\/wp-content\\/uploads\\/2021\\/09\\/20210925_105558.jpg\",\"url\":\"https:\\/\\/mc.scsiraidguru.com\\/wp-content\\/uploads\\/2021\\/09\\/20210925_105558.jpg\",\"contentUrl\":\"https:\\/\\/mc.scsiraidguru.com\\/wp-content\\/uploads\\/2021\\/09\\/20210925_105558.jpg\",\"width\":2560,\"height\":1440,\"caption\":\"Michael McKenney\"},\"logo\":{\"@id\":\"https:\\/\\/mc.scsiraidguru.com\\/wp-content\\/uploads\\/2021\\/09\\/20210925_105558.jpg\"},\"sameAs\":[\"http:\\\/\\\/mc.scsiraidguru.com\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Ard_RGB_LED -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/mc.scsiraidguru.com\/index.php\/arduino\/diode\/ard_light_emitting\/ard_rgb_led\/","og_locale":"en_US","og_type":"article","og_title":"Ard_RGB_LED -","og_description":"I have been reading Jeremy Blum&#8217;s Exploring Arduino.\u00a0\u00a0 I had a RGB LED in the box.\u00a0\u00a0 So I decided to try his code out.\u00a0\u00a0 The only difference was the type.\u00a0 It was a cathode RGB LED.\u00a0 To get it to work, I had to take it to the ground instead of 5V.\u00a0\u00a0\u00a0 I connected it [&hellip;]","og_url":"https:\/\/mc.scsiraidguru.com\/index.php\/arduino\/diode\/ard_light_emitting\/ard_rgb_led\/","article_modified_time":"2024-03-06T16:10:08+00:00","og_image":[{"url":"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:289\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/06\/7-segment-LED-with-SN74HC595.jpg","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/mc.scsiraidguru.com\/index.php\/arduino\/diode\/ard_light_emitting\/ard_rgb_led\/","url":"https:\/\/mc.scsiraidguru.com\/index.php\/arduino\/diode\/ard_light_emitting\/ard_rgb_led\/","name":"Ard_RGB_LED -","isPartOf":{"@id":"https:\/\/mc.scsiraidguru.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mc.scsiraidguru.com\/index.php\/arduino\/diode\/ard_light_emitting\/ard_rgb_led\/#primaryimage"},"image":{"@id":"https:\/\/mc.scsiraidguru.com\/index.php\/arduino\/diode\/ard_light_emitting\/ard_rgb_led\/#primaryimage"},"thumbnailUrl":"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:289\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/06\/7-segment-LED-with-SN74HC595.jpg","datePublished":"2021-06-26T11:11:26+00:00","dateModified":"2024-03-06T16:10:08+00:00","breadcrumb":{"@id":"https:\/\/mc.scsiraidguru.com\/index.php\/arduino\/diode\/ard_light_emitting\/ard_rgb_led\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mc.scsiraidguru.com\/index.php\/arduino\/diode\/ard_light_emitting\/ard_rgb_led\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mc.scsiraidguru.com\/index.php\/arduino\/diode\/ard_light_emitting\/ard_rgb_led\/#primaryimage","url":"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:auto\/h:auto\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/06\/7-segment-LED-with-SN74HC595.jpg","contentUrl":"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:auto\/h:auto\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/06\/7-segment-LED-with-SN74HC595.jpg","width":847,"height":816},{"@type":"BreadcrumbList","@id":"https:\/\/mc.scsiraidguru.com\/index.php\/arduino\/diode\/ard_light_emitting\/ard_rgb_led\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mc.scsiraidguru.com\/"},{"@type":"ListItem","position":2,"name":"Arduino","item":"https:\/\/mc.scsiraidguru.com\/index.php\/arduino\/"},{"@type":"ListItem","position":3,"name":"ard_diode","item":"https:\/\/mc.scsiraidguru.com\/index.php\/arduino\/diode\/"},{"@type":"ListItem","position":4,"name":"Ard_Light_Emitting","item":"https:\/\/mc.scsiraidguru.com\/index.php\/arduino\/diode\/ard_light_emitting\/"},{"@type":"ListItem","position":5,"name":"Ard_RGB_LED"}]},{"@type":"WebSite","@id":"https:\/\/mc.scsiraidguru.com\/#website","url":"https:\/\/mc.scsiraidguru.com\/","name":"SCSIraidGURU MC World","description":"","publisher":{"@id":"https:\/\/mc.scsiraidguru.com\/#\/schema\/person\/f21e3238456a7c2adea5944cb376cddc"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/mc.scsiraidguru.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/mc.scsiraidguru.com\/#\/schema\/person\/f21e3238456a7c2adea5944cb376cddc","name":"Michael McKenney","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:auto\/h:auto\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/09\/20210925_105558.jpg","url":"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:auto\/h:auto\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/09\/20210925_105558.jpg","contentUrl":"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:auto\/h:auto\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/09\/20210925_105558.jpg","width":2560,"height":1440,"caption":"Michael McKenney"},"logo":{"@id":"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:auto\/h:auto\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/09\/20210925_105558.jpg"},"sameAs":["http:\/\/mc.scsiraidguru.com"]}]}},"_links":{"self":[{"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/pages\/747","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/comments?post=747"}],"version-history":[{"count":17,"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/pages\/747\/revisions"}],"predecessor-version":[{"id":7760,"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/pages\/747\/revisions\/7760"}],"up":[{"embeddable":true,"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/pages\/709"}],"wp:attachment":[{"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/media?parent=747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}