Skip to content

Instantly share code, notes, and snippets.

@tiagodalloca
Created October 3, 2017 14:07
Show Gist options
  • Save tiagodalloca/d51a75ec062eb44647acf1ec533f42c2 to your computer and use it in GitHub Desktop.
Save tiagodalloca/d51a75ec062eb44647acf1ec533f42c2 to your computer and use it in GitHub Desktop.
Traz o led que pisca
import RPi.GPIO as gpio
import time
gpio.setmode(gpio.BCM)
gpio.setup(17, gpio.OUT)
gpio.setup(18, gpio.OUT)
gpio.setup(22, gpio.OUT)
gpio.setup(23, gpio.OUT)
gpio.setup(24, gpio.OUT)
gpio.setup(25, gpio.OUT)
try:
gpio.output(17, gpio.HIGH)
gpio.output(18, gpio.HIGH)
gpio.output(22, gpio.HIGH)
gpio.output(23, gpio.HIGH)
gpio.output(24, gpio.HIGH)
gpio.output(25, gpio.HIGH)
while (1):
gpio.output(17, gpio.HIGH)
gpio.output(18, gpio.HIGH)
gpio.output(22, gpio.HIGH)
gpio.output(23, gpio.HIGH)
gpio.output(24, gpio.HIGH)
gpio.output(25, gpio.HIGH)
time.sleep(0.1)
gpio.output(17, gpio.LOW)
gpio.output(18, gpio.LOW)
gpio.output(22, gpio.LOW)
gpio.output(23, gpio.LOW)
gpio.output(24, gpio.LOW)
gpio.output(25, gpio.LOW)
time.sleep(0.1)
except KeyboardInterrupt:
gpio.output(17, gpio.LOW)
gpio.output(18, gpio.LOW)
gpio.output(22, gpio.LOW)
gpio.output(23, gpio.LOW)
gpio.output(24, gpio.LOW)
gpio.output(25, gpio.LOW)
pass
gpio.cleanup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment