{"id":2200,"date":"2021-09-25T22:29:30","date_gmt":"2021-09-25T22:29:30","guid":{"rendered":"http:\/\/mc.scsiraidguru.com\/?page_id=2200"},"modified":"2024-03-04T00:28:29","modified_gmt":"2024-03-04T00:28:29","slug":"light_emitting","status":"publish","type":"page","link":"https:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/pi_diode\/light_emitting\/","title":{"rendered":"blink"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"2200\" class=\"elementor elementor-2200\" data-elementor-post-type=\"page\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-ebf94b7 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ebf94b7\" 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-b63f022\" data-id=\"b63f022\" 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-91925b9 elementor-widget elementor-widget-text-editor\" data-id=\"91925b9\" 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 style=\"padding-left: 40px;\"><em class=\"property\">class <\/em><code class=\"descclassname\">gpiozero.<\/code><code class=\"descname\">LED<\/code><span class=\"sig-paren\">(<\/span><em>pin<\/em>,\u00a0<em>*<\/em>,\u00a0<em>active_high=True<\/em>,\u00a0<em>initial_value=False<\/em>,\u00a0<em>pin_factory=None<\/em><span class=\"sig-paren\">)<\/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-4e58ecd elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4e58ecd\" 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-8c1a331\" data-id=\"8c1a331\" 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-626f31d elementor-widget elementor-widget-image\" data-id=\"626f31d\" 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\/http:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/10\/blink.jpg\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"blink\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MjQ0MywidXJsIjoiaHR0cHM6XC9cL21jLnNjc2lyYWlkZ3VydS5jb21cL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjFcLzEwXC9ibGluay5qcGcifQ%3D%3D\">\n\t\t\t\t\t\t\t<img data-opt-id=683020985  fetchpriority=\"high\" decoding=\"async\" width=\"300\" height=\"164\" src=\"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:164\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/10\/blink.jpg\" class=\"attachment-medium size-medium wp-image-2443\" alt=\"\" srcset=\"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:1528\/h:836\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/10\/blink.jpg 1528w, https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:164\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/10\/blink.jpg 300w, https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:1024\/h:560\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/10\/blink.jpg 1024w, https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:768\/h:420\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/10\/blink.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-b0a7fc9 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"b0a7fc9\" 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-3a316ec\" data-id=\"3a316ec\" 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-c52ffe5 elementor-widget elementor-widget-text-editor\" data-id=\"c52ffe5\" 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>Blink.py is a while loop to blink the LED every one second.<\/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-49c0d7c elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"49c0d7c\" 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-da04cd5\" data-id=\"da04cd5\" 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-01af450 elementor-widget elementor-widget-text-editor\" data-id=\"01af450\" 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># basic_i2c_configuration<br \/><br \/>import RPi.GPIO as GPIO<br \/>import time<br \/>from smbus import SMBus<br \/><br \/>bus = SMBus(1) # indicates \/dev\/ic2-1<br \/><br \/><br \/>def destroy():<br \/>GPIO.cleanup()<br \/><br \/><br \/>def setup():<br \/>while True:<br \/>GPIO.setwarnings(False)<br \/>GPIO.setmode(GPIO.BCM)<br \/>red = 24<br \/># GPIO.setmode(GPIO.BOARD)<br \/># red = 18<br \/>GPIO.setup(red,GPIO.OUT)<br \/>GPIO.output(red,1)<br \/>time.sleep(1)<br \/>GPIO.output(red,0)<br \/>time.sleep(1)<br \/><br \/><br \/>def loop():<br \/>print(\"\")<br \/><br \/><br \/>if __name__ == '__main__':<br \/>print ('Program is starting...' )<br \/>setup()<br \/>try:<br \/>loop()<br \/>except KeyboardInterrupt:<br \/>destroy()<\/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<section class=\"elementor-section elementor-top-section elementor-element elementor-element-a0410af elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a0410af\" 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-47af225\" data-id=\"47af225\" 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-1dcb1d8 elementor-widget elementor-widget-image\" data-id=\"1dcb1d8\" 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\/http:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/10\/five_method_led.jpg\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"five_method_led\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MjUyOSwidXJsIjoiaHR0cHM6XC9cL21jLnNjc2lyYWlkZ3VydS5jb21cL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjFcLzEwXC9maXZlX21ldGhvZF9sZWQuanBnIn0%3D\">\n\t\t\t\t\t\t\t<img data-opt-id=93777842  fetchpriority=\"high\" decoding=\"async\" width=\"300\" height=\"160\" src=\"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:160\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/10\/five_method_led.jpg\" class=\"attachment-medium size-medium wp-image-2529\" alt=\"\" srcset=\"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:1539\/h:822\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/10\/five_method_led.jpg 1539w, https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:160\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/10\/five_method_led.jpg 300w, https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:1024\/h:547\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/10\/five_method_led.jpg 1024w, https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:768\/h:410\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/10\/five_method_led.jpg 768w, https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:1536\/h:820\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/10\/five_method_led.jpg 1536w\" 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-ccfd779 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ccfd779\" 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-f3d2eb5\" data-id=\"f3d2eb5\" 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-f62e206 elementor-widget elementor-widget-text-editor\" data-id=\"f62e206\" 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>Five methods of blinking an LED.\u00a0 I placed a Red LED on GPIO 24 and Blue LED on GPIO 18.\u00a0\u00a0 I could have done the same connection through the single supply logic level converter.\u00a0\u00a0 It could have been 5V for the LED instead of 3.3V.\u00a0\u00a0 <\/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-d1e228e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"d1e228e\" 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-e8da99a\" data-id=\"e8da99a\" 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-374aaba elementor-widget elementor-widget-text-editor\" data-id=\"374aaba\" 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># basic_i2c_configuration<br \/><br \/>import RPi.GPIO as GPIO<br \/>import time<br \/>from smbus import SMBus<br \/><br \/>bus = SMBus(1) # indicates \/dev\/ic2-1<br \/><br \/><br \/>def destroy():<br \/>GPIO.cleanup()<br \/><br \/><br \/>def setup():<br \/>while True:<br \/>GPIO.setwarnings(False)<br \/>GPIO.setmode(GPIO.BCM)<br \/>red = 24<br \/># GPIO.setmode(GPIO.BOARD)<br \/># red = 18<br \/>GPIO.setup(red,GPIO.OUT)<br \/>GPIO.output(red,1)<br \/>time.sleep(1)<br \/>GPIO.output(red,0)<br \/>time.sleep(1)<br \/><br \/><br \/>def loop():<br \/>print(\"\")<br \/><br \/><br \/>if __name__ == '__main__':<br \/>print ('Program is starting...' )<br \/>setup()<br \/>try:<br \/>loop()<br \/>except KeyboardInterrupt:<br \/>destroy()<br \/><br \/><br \/>michael@wpmm22:\/var\/www\/mc.scsiraidguru.com\/public_html\/raspberry_pi\/pi_diode\/light_emitting$<br \/>michael@wpmm22:\/var\/www\/mc.scsiraidguru.com\/public_html\/raspberry_pi\/pi_diode\/light_emitting$ ls<br \/>blink.jpg blink.py five_method_blink.py<br \/>michael@wpmm22:\/var\/www\/mc.scsiraidguru.com\/public_html\/raspberry_pi\/pi_diode\/light_emitting$ sudo cat five_method_blink.py<br \/>from gpiozero import LED<br \/>from time import sleep<br \/>from signal import pause<br \/><br \/>print(\"init LCD\")<br \/>led_red = LED(24)<br \/><br \/><br \/>print(\"Start Blinking LED 10x\")<br \/>for x in range(0, 11):<br \/>print(\"Turn on LED\")<br \/>led_red.on()<br \/>sleep(1)<br \/>print(\"Turn off LED\")<br \/>led_red.off()<br \/>sleep(1)<br \/><br \/><br \/>print(\"Second method setting active_high to false blinking 10x\")<br \/>led_blue = LED(18, active_high=False)<br \/>for x in range(0, 11):<br \/>print(\"Turn on LED\")<br \/>led_blue.on()<br \/>sleep(1)<br \/>print(\"Turn off LED\")<br \/>led_blue.off()<br \/>sleep(1)<br \/><br \/><br \/>print(\"third method with led.toggle for blinking 10x\")<br \/><br \/>for x in range(0, 11):<br \/>led_red.toggle()<br \/>sleep(1)<br \/><br \/>print(\"fourth method uses led.blink to do all functions\")<br \/>print(\"Turn on blinking\")<br \/>led_red.blink(on_time=1, off_time=1, n=10, background=False)<br \/>print(\"turn off blinking\")<br \/><br \/><br \/><br \/><br \/>print(\"fifth method with led.blink and pause 10x\")<br \/>for x in range(0, 11):<br \/>print(\"Turn on LED\")<br \/>led_red.blink()<br \/>pause()<\/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>class gpiozero.LED(pin,\u00a0*,\u00a0active_high=True,\u00a0initial_value=False,\u00a0pin_factory=None) Blink.py is a while loop to blink the LED every one second. # basic_i2c_configurationimport RPi.GPIO as GPIOimport timefrom smbus import SMBusbus = SMBus(1) # indicates \/dev\/ic2-1def destroy():GPIO.cleanup()def setup():while True:GPIO.setwarnings(False)GPIO.setmode(GPIO.BCM)red = 24# GPIO.setmode(GPIO.BOARD)# red = 18GPIO.setup(red,GPIO.OUT)GPIO.output(red,1)time.sleep(1)GPIO.output(red,0)time.sleep(1)def loop():print(&#8220;&#8221;)if __name__ == &#8216;__main__&#8217;:print (&#8216;Program is starting&#8230;&#8217; )setup()try:loop()except KeyboardInterrupt:destroy() Five methods of blinking an LED.\u00a0 I placed a [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":2194,"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":"7151","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-2200","page","type-page","status-publish","hentry","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>blink - mc.scsiraidguru.com<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/pi_diode\/light_emitting\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"blink - mc.scsiraidguru.com\" \/>\n<meta property=\"og:description\" content=\"class gpiozero.LED(pin,\u00a0*,\u00a0active_high=True,\u00a0initial_value=False,\u00a0pin_factory=None) Blink.py is a while loop to blink the LED every one second. # basic_i2c_configurationimport RPi.GPIO as GPIOimport timefrom smbus import SMBusbus = SMBus(1) # indicates \/dev\/ic2-1def destroy():GPIO.cleanup()def setup():while True:GPIO.setwarnings(False)GPIO.setmode(GPIO.BCM)red = 24# GPIO.setmode(GPIO.BOARD)# red = 18GPIO.setup(red,GPIO.OUT)GPIO.output(red,1)time.sleep(1)GPIO.output(red,0)time.sleep(1)def loop():print(&quot;&quot;)if __name__ == &#039;__main__&#039;:print (&#039;Program is starting...&#039; )setup()try:loop()except KeyboardInterrupt:destroy() Five methods of blinking an LED.\u00a0 I placed a [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/pi_diode\/light_emitting\/\" \/>\n<meta property=\"og:site_name\" content=\"mc.scsiraidguru.com\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-04T00:28:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:164\/q:mauto\/f:best\/http:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/10\/blink.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\":\"http:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/pi_diode\\\/light_emitting\\\/\",\"url\":\"http:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/pi_diode\\\/light_emitting\\\/\",\"name\":\"blink - mc.scsiraidguru.com\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"http:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/pi_diode\\\/light_emitting\\\/#primaryimage\"},\"image\":{\"@id\":\"http:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/pi_diode\\\/light_emitting\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\/\\/mc.scsiraidguru.com\\/wp-content\\/uploads\\/2021\\/10\\/blink-300x164.jpg\",\"datePublished\":\"2021-09-25T22:29:30+00:00\",\"dateModified\":\"2024-03-04T00:28:29+00:00\",\"breadcrumb\":{\"@id\":\"http:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/pi_diode\\\/light_emitting\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/pi_diode\\\/light_emitting\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/pi_diode\\\/light_emitting\\\/#primaryimage\",\"url\":\"https:\\/\\/mc.scsiraidguru.com\\/wp-content\\/uploads\\/2021\\/10\\/blink.jpg\",\"contentUrl\":\"https:\\/\\/mc.scsiraidguru.com\\/wp-content\\/uploads\\/2021\\/10\\/blink.jpg\",\"width\":1528,\"height\":836},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/pi_diode\\\/light_emitting\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\\\/\\\/mc.scsiraidguru.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Raspberry Pi\",\"item\":\"http:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"pi_diode\",\"item\":\"http:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/pi_diode\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"blink\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/#website\",\"url\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/\",\"name\":\"SCSIraidGURU MC World\",\"description\":\"mc.scsiraidguru.com\",\"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\":\"http:\\/\\/mc.scsiraidguru.com\\/wp-content\\/uploads\\/2021\\/09\\/20210925_105558.jpg\",\"url\":\"http:\\/\\/mc.scsiraidguru.com\\/wp-content\\/uploads\\/2021\\/09\\/20210925_105558.jpg\",\"contentUrl\":\"http:\\/\\/mc.scsiraidguru.com\\/wp-content\\/uploads\\/2021\\/09\\/20210925_105558.jpg\",\"width\":2560,\"height\":1440,\"caption\":\"Michael McKenney\"},\"logo\":{\"@id\":\"http:\\/\\/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":"blink - mc.scsiraidguru.com","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":"http:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/pi_diode\/light_emitting\/","og_locale":"en_US","og_type":"article","og_title":"blink - mc.scsiraidguru.com","og_description":"class gpiozero.LED(pin,\u00a0*,\u00a0active_high=True,\u00a0initial_value=False,\u00a0pin_factory=None) Blink.py is a while loop to blink the LED every one second. # basic_i2c_configurationimport RPi.GPIO as GPIOimport timefrom smbus import SMBusbus = SMBus(1) # indicates \/dev\/ic2-1def destroy():GPIO.cleanup()def setup():while True:GPIO.setwarnings(False)GPIO.setmode(GPIO.BCM)red = 24# GPIO.setmode(GPIO.BOARD)# red = 18GPIO.setup(red,GPIO.OUT)GPIO.output(red,1)time.sleep(1)GPIO.output(red,0)time.sleep(1)def loop():print(\"\")if __name__ == '__main__':print ('Program is starting...' )setup()try:loop()except KeyboardInterrupt:destroy() Five methods of blinking an LED.\u00a0 I placed a [&hellip;]","og_url":"http:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/pi_diode\/light_emitting\/","og_site_name":"mc.scsiraidguru.com","article_modified_time":"2024-03-04T00:28:29+00:00","og_image":[{"url":"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:164\/q:mauto\/f:best\/http:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/10\/blink.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":"http:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/pi_diode\/light_emitting\/","url":"http:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/pi_diode\/light_emitting\/","name":"blink - mc.scsiraidguru.com","isPartOf":{"@id":"https:\/\/mc.scsiraidguru.com\/#website"},"primaryImageOfPage":{"@id":"http:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/pi_diode\/light_emitting\/#primaryimage"},"image":{"@id":"http:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/pi_diode\/light_emitting\/#primaryimage"},"thumbnailUrl":"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:164\/q:mauto\/f:best\/http:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/10\/blink.jpg","datePublished":"2021-09-25T22:29:30+00:00","dateModified":"2024-03-04T00:28:29+00:00","breadcrumb":{"@id":"http:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/pi_diode\/light_emitting\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/pi_diode\/light_emitting\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/pi_diode\/light_emitting\/#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\/10\/blink.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\/10\/blink.jpg","width":1528,"height":836},{"@type":"BreadcrumbList","@id":"http:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/pi_diode\/light_emitting\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/mc.scsiraidguru.com\/"},{"@type":"ListItem","position":2,"name":"Raspberry Pi","item":"http:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/"},{"@type":"ListItem","position":3,"name":"pi_diode","item":"http:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/pi_diode\/"},{"@type":"ListItem","position":4,"name":"blink"}]},{"@type":"WebSite","@id":"https:\/\/mc.scsiraidguru.com\/#website","url":"https:\/\/mc.scsiraidguru.com\/","name":"SCSIraidGURU MC World","description":"mc.scsiraidguru.com","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\/http:\/\/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\/http:\/\/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\/http:\/\/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\/http:\/\/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\/2200","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=2200"}],"version-history":[{"count":79,"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/pages\/2200\/revisions"}],"predecessor-version":[{"id":7707,"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/pages\/2200\/revisions\/7707"}],"up":[{"embeddable":true,"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/pages\/2194"}],"wp:attachment":[{"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/media?parent=2200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}