{"id":1592,"date":"2021-09-07T16:34:55","date_gmt":"2021-09-07T16:34:55","guid":{"rendered":"https:\/\/mc.scsiraidguru.com\/?page_id=1592"},"modified":"2024-03-06T16:27:07","modified_gmt":"2024-03-06T16:27:07","slug":"7-segment-display-lsbfirst","status":"publish","type":"page","link":"https:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/shift-registers\/sn74hc595_pi\/7-segment-display-lsbfirst\/","title":{"rendered":"7 Segment Display LSBFirst"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"1592\" class=\"elementor elementor-1592\" data-elementor-post-type=\"page\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-0de2c71 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"0de2c71\" 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-941e37e\" data-id=\"941e37e\" 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-78170bd elementor-widget elementor-widget-text-editor\" data-id=\"78170bd\" 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>import RPi.GPIO as GPIO\nimport time\n\nLSBFIRST = 1\nMSBFIRST = 2\n\ndataPin   = 11    #DS Pin of 74HC595(Pin14)\nlatchPin  = 13    #ST_CP Pin of 74HC595(Pin12)\nclockPin = 15    #CH_CP Pin of 74HC595(Pin11)\n\ndef setup():\n  GPIO.setwarnings(False)\n  GPIO.setmode(GPIO.BOARD)\n  GPIO.setup(dataPin, GPIO.OUT)\n  GPIO.setup(latchPin, GPIO.OUT)\n  GPIO.setup(clockPin, GPIO.OUT)\n  \ndef shiftOut(dPin,cPin,order,val):\n  for i in range(0,8):\n    GPIO.output(cPin,GPIO.LOW);\n    if(order == LSBFIRST):\n      GPIO.output(dPin,(0x01&amp;(val&gt;&gt;i)==0x01) and GPIO.HIGH or GPIO.LOW)\n    elif(order == MSBFIRST):\n      GPIO.output(dPin,(0x80&amp;(val&lt;&lt;i)==0x80) and GPIO.HIGH or GPIO.LOW)\n    GPIO.output(cPin,GPIO.HIGH);  \n\t\ndef loop():\n  while True:\n\n    # number 0xfc is 0\n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0xfc)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(2)\n         \n    # blank \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x00)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(0.1)\n    \n    # number 0x60 is number 1\n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x60)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(2)\n         \n    # blank \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x00)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(0.1)\n    \n    # number 0xda is number 2\n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0xda)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(2)\n         \n    # blank \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x00)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(0.1)\n            \n    # number 0xf2 is number 3\n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0xf2)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(2)\n         \n    # blank \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x00)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(0.1)\n    \n    # number 0x66 is number 4\n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x66)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(2)\n         \n    # blank \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x00)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(0.1)\n        \n    # number 5 is 0xb6 \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0xb6)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(2)\n    \n    # blank \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x00)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(0.1)\n    \n    # number 6 is 0xbe\n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0xbe)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(2)\n    \n    # blank \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x00)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(0.1)\n    \n    # number 0xe0 is number 7\n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0xe0)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(2)\n         \n    # blank \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x00)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(0.1)\n    \n    # number 0xfe is number 8\n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0xfe)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(2)\n         \n    # blank \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x00)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(0.1)\n    \n        \n    # number 0xe6 is number 9\n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0xe6)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(2)\n         \n    # blank \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x00)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(0.1)\n    \n    # number 0xee is number 10 or A\n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0xee)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(2)\n         \n    # blank \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x00)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(0.1)\n    \n    # number 0x3e is number 11 or b\n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x3e)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(2)\n         \n    # blank \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x00)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(0.1)\n    \n    \n    # number 0x1a is 12 or c\n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x1a)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(2)\n         \n    # blank \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x00)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(0.1)\n    \n    # number 0x7a is 13 or d\n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x7a)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(2)  \n         \n    # blank \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x00)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(0.1)\n    \n    # number 0x9e is 14 or e\n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x9e)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(2)  \n         \n    # blank \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x00)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(0.1)     \n     \n      # number 0x8e is 15 or f\n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,LSBFIRST,0x8e)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(2)  \n         \n    # blank \n    GPIO.output(latchPin,GPIO.LOW)\n    shiftOut(dataPin,clockPin,MSBFIRST,0x00)\n    GPIO.output(latchPin,GPIO.HIGH)\n    time.sleep(0.1)    \n     \n     \n     \ndef destroy(): \n  GPIO.cleanup()\n\nif __name__ == '__main__':\n  print ('Program is starting...' )\n  setup() \n  try:\n    loop()  \n  except KeyboardInterrupt:  \n    destroy()   \n\t<\/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-35ac8b4 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"35ac8b4\" 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-5c5c315\" data-id=\"5c5c315\" 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-c753bce elementor-widget elementor-widget-text-editor\" data-id=\"c753bce\" 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=\"text-align: center;\"><a href=\"https:\/\/mc.scsiraidguru.com\/raspberry_pi\/shift_registers_pi\/SN74HC595_pi\/7Segment_LSBFirst\/7Segment_LSBFirst.py\">7Segment_LSBFirst.py<\/a><\/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-4490cbf elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4490cbf\" 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-13882c8\" data-id=\"13882c8\" 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-d213a86 elementor-widget elementor-widget-image\" data-id=\"d213a86\" 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\/09\/5611AH_Pinout.jpg\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"5611AH_Pinout\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MTU4NSwidXJsIjoiaHR0cHM6XC9cL21jLnNjc2lyYWlkZ3VydS5jb21cL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjFcLzA5XC81NjExQUhfUGlub3V0LmpwZyJ9\">\n\t\t\t\t\t\t\t<img data-opt-id=983821350  fetchpriority=\"high\" decoding=\"async\" width=\"300\" height=\"259\" src=\"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:259\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/09\/5611AH_Pinout.jpg\" class=\"attachment-medium size-medium wp-image-1585\" alt=\"\" srcset=\"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:586\/h:506\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/09\/5611AH_Pinout.jpg 586w, https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:259\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/09\/5611AH_Pinout.jpg 300w\" 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-bae87cf elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"bae87cf\" 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-4e20b97\" data-id=\"4e20b97\" 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-15aa33c elementor-widget elementor-widget-text-editor\" data-id=\"15aa33c\" 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>Logic Table for LSBFirst.\u00a0 Least Significant Bit is A.\u00a0 It would be thefirst bit: A to H<\/p><p>A-D is the First Bit<br \/>E-H is the Second Bit<\/p><p>First Bit= 8*D + 4*C + 2*B + 1*A<br \/>Second Bit = 8*H + 4*G + 2*F + 1*E<\/p><p>It is done in Hex:\u00a0 0-9 are just 0-9.\u00a0\u00a0 10 is A, 11 is B, 12 is C, 13 is D, 14 is E, 15 is F.<\/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-4cb223b elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"4cb223b\" 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-0af1b23\" data-id=\"0af1b23\" 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-9cf3870 elementor-widget elementor-widget-image\" data-id=\"9cf3870\" 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\/09\/lsb_logic_table.jpg\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"lsb_logic_table\" data-e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MTYxOCwidXJsIjoiaHR0cHM6XC9cL21jLnNjc2lyYWlkZ3VydS5jb21cL3dwLWNvbnRlbnRcL3VwbG9hZHNcLzIwMjFcLzA5XC9sc2JfbG9naWNfdGFibGUuanBnIn0%3D\">\n\t\t\t\t\t\t\t<img data-opt-id=403258774  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\/09\/lsb_logic_table.jpg\" class=\"attachment-medium size-medium wp-image-1618\" alt=\"\" srcset=\"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:641\/h:341\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/09\/lsb_logic_table.jpg 641w, https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:160\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/09\/lsb_logic_table.jpg 300w\" 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<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>import RPi.GPIO as GPIO import time LSBFIRST = 1 MSBFIRST = 2 dataPin = 11 #DS Pin of 74HC595(Pin14) latchPin = 13 #ST_CP Pin of 74HC595(Pin12) clockPin = 15 #CH_CP Pin of 74HC595(Pin11) def setup(): GPIO.setwarnings(False) GPIO.setmode(GPIO.BOARD) GPIO.setup(dataPin, GPIO.OUT) GPIO.setup(latchPin, GPIO.OUT) GPIO.setup(clockPin, GPIO.OUT) def shiftOut(dPin,cPin,order,val): for i in range(0,8): GPIO.output(cPin,GPIO.LOW); if(order == LSBFIRST): GPIO.output(dPin,(0x01&amp;(val&gt;&gt;i)==0x01) and [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":1570,"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":"7164","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-1592","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>7 Segment Display LSBFirst -<\/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\/raspberry-pi\/shift-registers\/sn74hc595_pi\/7-segment-display-lsbfirst\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"7 Segment Display LSBFirst -\" \/>\n<meta property=\"og:description\" content=\"import RPi.GPIO as GPIO import time LSBFIRST = 1 MSBFIRST = 2 dataPin = 11 #DS Pin of 74HC595(Pin14) latchPin = 13 #ST_CP Pin of 74HC595(Pin12) clockPin = 15 #CH_CP Pin of 74HC595(Pin11) def setup(): GPIO.setwarnings(False) GPIO.setmode(GPIO.BOARD) GPIO.setup(dataPin, GPIO.OUT) GPIO.setup(latchPin, GPIO.OUT) GPIO.setup(clockPin, GPIO.OUT) def shiftOut(dPin,cPin,order,val): for i in range(0,8): GPIO.output(cPin,GPIO.LOW); if(order == LSBFIRST): GPIO.output(dPin,(0x01&amp;(val&gt;&gt;i)==0x01) and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/shift-registers\/sn74hc595_pi\/7-segment-display-lsbfirst\/\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-06T16:27:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:259\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/09\/5611AH_Pinout.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\\\/raspberry-pi\\\/shift-registers\\\/sn74hc595_pi\\\/7-segment-display-lsbfirst\\\/\",\"url\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/shift-registers\\\/sn74hc595_pi\\\/7-segment-display-lsbfirst\\\/\",\"name\":\"7 Segment Display LSBFirst -\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/shift-registers\\\/sn74hc595_pi\\\/7-segment-display-lsbfirst\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/shift-registers\\\/sn74hc595_pi\\\/7-segment-display-lsbfirst\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\/\\/mc.scsiraidguru.com\\/wp-content\\/uploads\\/2021\\/09\\/5611AH_Pinout-300x259.jpg\",\"datePublished\":\"2021-09-07T16:34:55+00:00\",\"dateModified\":\"2024-03-06T16:27:07+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/shift-registers\\\/sn74hc595_pi\\\/7-segment-display-lsbfirst\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/shift-registers\\\/sn74hc595_pi\\\/7-segment-display-lsbfirst\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/shift-registers\\\/sn74hc595_pi\\\/7-segment-display-lsbfirst\\\/#primaryimage\",\"url\":\"https:\\/\\/mc.scsiraidguru.com\\/wp-content\\/uploads\\/2021\\/09\\/5611AH_Pinout.jpg\",\"contentUrl\":\"https:\\/\\/mc.scsiraidguru.com\\/wp-content\\/uploads\\/2021\\/09\\/5611AH_Pinout.jpg\",\"width\":586,\"height\":506},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/shift-registers\\\/sn74hc595_pi\\\/7-segment-display-lsbfirst\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Raspberry Pi\",\"item\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Shift Registers_Pi\",\"item\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/shift-registers\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"SN74HC595_Pi\",\"item\":\"https:\\\/\\\/mc.scsiraidguru.com\\\/index.php\\\/raspberry-pi\\\/shift-registers\\\/sn74hc595_pi\\\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"7 Segment Display LSBFirst\"}]},{\"@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":"7 Segment Display LSBFirst -","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\/raspberry-pi\/shift-registers\/sn74hc595_pi\/7-segment-display-lsbfirst\/","og_locale":"en_US","og_type":"article","og_title":"7 Segment Display LSBFirst -","og_description":"import RPi.GPIO as GPIO import time LSBFIRST = 1 MSBFIRST = 2 dataPin = 11 #DS Pin of 74HC595(Pin14) latchPin = 13 #ST_CP Pin of 74HC595(Pin12) clockPin = 15 #CH_CP Pin of 74HC595(Pin11) def setup(): GPIO.setwarnings(False) GPIO.setmode(GPIO.BOARD) GPIO.setup(dataPin, GPIO.OUT) GPIO.setup(latchPin, GPIO.OUT) GPIO.setup(clockPin, GPIO.OUT) def shiftOut(dPin,cPin,order,val): for i in range(0,8): GPIO.output(cPin,GPIO.LOW); if(order == LSBFIRST): GPIO.output(dPin,(0x01&amp;(val&gt;&gt;i)==0x01) and [&hellip;]","og_url":"https:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/shift-registers\/sn74hc595_pi\/7-segment-display-lsbfirst\/","article_modified_time":"2024-03-06T16:27:07+00:00","og_image":[{"url":"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:259\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/09\/5611AH_Pinout.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\/raspberry-pi\/shift-registers\/sn74hc595_pi\/7-segment-display-lsbfirst\/","url":"https:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/shift-registers\/sn74hc595_pi\/7-segment-display-lsbfirst\/","name":"7 Segment Display LSBFirst -","isPartOf":{"@id":"https:\/\/mc.scsiraidguru.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/shift-registers\/sn74hc595_pi\/7-segment-display-lsbfirst\/#primaryimage"},"image":{"@id":"https:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/shift-registers\/sn74hc595_pi\/7-segment-display-lsbfirst\/#primaryimage"},"thumbnailUrl":"https:\/\/mlbxg5wzacc0.i.optimole.com\/cb:FyJ0.12d22\/w:300\/h:259\/q:mauto\/f:best\/https:\/\/mc.scsiraidguru.com\/wp-content\/uploads\/2021\/09\/5611AH_Pinout.jpg","datePublished":"2021-09-07T16:34:55+00:00","dateModified":"2024-03-06T16:27:07+00:00","breadcrumb":{"@id":"https:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/shift-registers\/sn74hc595_pi\/7-segment-display-lsbfirst\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/shift-registers\/sn74hc595_pi\/7-segment-display-lsbfirst\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/shift-registers\/sn74hc595_pi\/7-segment-display-lsbfirst\/#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\/09\/5611AH_Pinout.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\/5611AH_Pinout.jpg","width":586,"height":506},{"@type":"BreadcrumbList","@id":"https:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/shift-registers\/sn74hc595_pi\/7-segment-display-lsbfirst\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/mc.scsiraidguru.com\/"},{"@type":"ListItem","position":2,"name":"Raspberry Pi","item":"https:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/"},{"@type":"ListItem","position":3,"name":"Shift Registers_Pi","item":"https:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/shift-registers\/"},{"@type":"ListItem","position":4,"name":"SN74HC595_Pi","item":"https:\/\/mc.scsiraidguru.com\/index.php\/raspberry-pi\/shift-registers\/sn74hc595_pi\/"},{"@type":"ListItem","position":5,"name":"7 Segment Display LSBFirst"}]},{"@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\/1592","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=1592"}],"version-history":[{"count":50,"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/pages\/1592\/revisions"}],"predecessor-version":[{"id":7777,"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/pages\/1592\/revisions\/7777"}],"up":[{"embeddable":true,"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/pages\/1570"}],"wp:attachment":[{"href":"https:\/\/mc.scsiraidguru.com\/index.php\/wp-json\/wp\/v2\/media?parent=1592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}