{"id":4711,"date":"2023-03-15T19:12:00","date_gmt":"2023-03-16T00:12:00","guid":{"rendered":"https:\/\/www.incredigeek.com\/home\/?p=4711"},"modified":"2023-03-15T18:56:20","modified_gmt":"2023-03-15T23:56:20","slug":"raspberry-pi-blink-light-python","status":"publish","type":"post","link":"https:\/\/www.incredigeek.com\/home\/raspberry-pi-blink-light-python\/","title":{"rendered":"Raspberry Pi &#8211; Blink Light &#8211; Python"},"content":{"rendered":"\n<p>A Simple Python script to blink a Raspberry Pi LED.  <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">import RPi.GPIO as GPIO\nfrom time import sleep\n\nGPIO.setwarnings(False)\nGPIO.setmode(GPIO.BOARD)  # Uses the physical pin numbering\nGPIO.setup(7, initial=GPIO.LOW)  # Set GPIO pin to off\n\nwhile True:\n    GPIO.output(7, GPIO.HIGH)\n    sleep(0.2)\n    GPIO.output(7, GPIO.LOW)\n    sleep(0.2)\n<\/pre>\n\n\n\n<p>Change pin numbers as needed.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-incredigeek wp-block-embed-incredigeek\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"RYHo8HxkNc\"><a href=\"https:\/\/www.incredigeek.com\/home\/raspberry-pi-pinouts\/\">Raspberry Pi Pinouts<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Raspberry Pi Pinouts&#8221; &#8212; Incredigeek\" src=\"https:\/\/www.incredigeek.com\/home\/raspberry-pi-pinouts\/embed\/#?secret=eQhgl5Ufp3#?secret=RYHo8HxkNc\" data-secret=\"RYHo8HxkNc\" width=\"584\" height=\"329\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>We can also do this with BASH.  <\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-wp-embed is-provider-incredigeek wp-block-embed-incredigeek\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"5OQTpIaWsG\"><a href=\"https:\/\/www.incredigeek.com\/home\/control-led-from-command-line-raspberry-pi\/\">Control LED from Command Line &#8211; Raspberry Pi<\/a><\/blockquote><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" title=\"&#8220;Control LED from Command Line &#8211; Raspberry Pi&#8221; &#8212; Incredigeek\" src=\"https:\/\/www.incredigeek.com\/home\/control-led-from-command-line-raspberry-pi\/embed\/#?secret=dGA78FMYqh#?secret=5OQTpIaWsG\" data-secret=\"5OQTpIaWsG\" width=\"584\" height=\"329\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><figcaption class=\"wp-element-caption\">Control LED using BASH<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>A Simple Python script to blink a Raspberry Pi LED. import RPi.GPIO as GPIO from time import sleep GPIO.setwarnings(False) GPIO.setmode(GPIO.BOARD) # Uses the physical pin numbering GPIO.setup(7, initial=GPIO.LOW) # Set GPIO pin to off while True: GPIO.output(7, GPIO.HIGH) sleep(0.2) GPIO.output(7, &hellip; <a href=\"https:\/\/www.incredigeek.com\/home\/raspberry-pi-blink-light-python\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[292,91],"tags":[210,1413,105],"class_list":["post-4711","post","type-post","status-publish","format-standard","hentry","category-python","category-raspberry-pi","tag-led","tag-light","tag-pi"],"_links":{"self":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4711","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/comments?post=4711"}],"version-history":[{"count":2,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4711\/revisions"}],"predecessor-version":[{"id":4875,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/posts\/4711\/revisions\/4875"}],"wp:attachment":[{"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/media?parent=4711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/categories?post=4711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.incredigeek.com\/home\/wp-json\/wp\/v2\/tags?post=4711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}