SlideShare a Scribd company logo
#!/usr/bin/python 
import RPi.GPIO as GPIO 
import time 
GPIO.setmode(GPIO.BCM) 
# init list with pin numbers 
pinList = [2, 3, 4, 17, 27, 22, 10, 9] 
# loop through pins and set mode and state to 'low' 
for i in pinList: 
GPIO.setup(i, GPIO.OUT) 
GPIO.output(i, GPIO.HIGH) 
# time to sleep between operations in the main loop 
SleepTimeL = 2 
# main loop 
try: 
GPIO.output(2, GPIO.LOW) 
print "ONE" 
time.sleep(SleepTimeL); 
GPIO.output(3, GPIO.LOW) 
print "TWO" 
time.sleep(SleepTimeL); 
GPIO.output(4, GPIO.LOW) 
print "THREE" 
time.sleep(SleepTimeL); 
GPIO.output(17, GPIO.LOW) 
print "FOUR" 
time.sleep(SleepTimeL); 
GPIO.output(27, GPIO.LOW) 
print "FIVE" 
time.sleep(SleepTimeL); 
GPIO.output(22, GPIO.LOW) 
print "SIX" 
time.sleep(SleepTimeL); 
GPIO.output(10, GPIO.LOW) 
print "SEVEN" 
time.sleep(SleepTimeL); 
GPIO.output(9, GPIO.LOW) 
print "EIGHT" 
time.sleep(SleepTimeL); 
GPIO.cleanup() 
print "Good bye!" 
# End program cleanly with keyboard 
except KeyboardInterrupt: 
print " Quit" 
# Reset GPIO settings 
GPIO.cleanup() 
# find more information on this script at 
# http://youtu.be/oaf_zQcrg7g

More Related Content

PPTX
Custard pi 7 user information
PDF
IL: 失われたプロトコル
PPTX
LED Blinking Using Raspberry Pi
ODP
Enhancing Free PBX with Adhearsion at Fosdem 2012
PDF
Coding in GO - GDG SL - NSBM
PDF
The PDP-10 - and me
TXT
Streaming status
PDF
今日から始めるPlan 9 from Bell Labs
Custard pi 7 user information
IL: 失われたプロトコル
LED Blinking Using Raspberry Pi
Enhancing Free PBX with Adhearsion at Fosdem 2012
Coding in GO - GDG SL - NSBM
The PDP-10 - and me
Streaming status
今日から始めるPlan 9 from Bell Labs

What's hot (19)

DOCX
Micro Assignment 1
PDF
Presentazione
PDF
Hands on Raspberry Pi - Creative Technologists
PDF
A Threshold Cryptosystem without a Trusted Party
ODP
The Dark Side of Programming Languages
PPTX
14. 8085 programming example vi
PDF
X86 assembly & GDB
PPTX
PDF
One round threshold ecdsa with identifiable abort
PPT
Pipe
PDF
How to develop a rich terminal UI application
PDF
multi-line record grep
PPTX
13. 8085 programming example v
PDF
Golangにおける端末制御 リッチなターミナルUIの実現方法
PDF
Let's golang
PDF
Golang勉強会
PPTX
Introduction to python for beginners
PDF
Plan 9でWebプログラミング
DOCX
Untitled document
Micro Assignment 1
Presentazione
Hands on Raspberry Pi - Creative Technologists
A Threshold Cryptosystem without a Trusted Party
The Dark Side of Programming Languages
14. 8085 programming example vi
X86 assembly & GDB
One round threshold ecdsa with identifiable abort
Pipe
How to develop a rich terminal UI application
multi-line record grep
13. 8085 programming example v
Golangにおける端末制御 リッチなターミナルUIの実現方法
Let's golang
Golang勉強会
Introduction to python for beginners
Plan 9でWebプログラミング
Untitled document
Ad

Similar to Script (20)

PDF
Python code for servo control using Raspberry Pi
PDF
1a Write the code using CircuitPython in Python Create a.pdf
PPTX
Python in raspberry pi
PPT
Sensors, actuators and the Raspberry PI using Python
PDF
4. GPIO Access
PDF
Getting Started With Raspberry Pi - UCSD 2013
PDF
Getting Started with Raspberry Pi - USC 2013
PPTX
[5]投影片 futurewad樹莓派研習會 141218
ODP
Introduction to Raspberry Pi and GPIO
PDF
Intro to the raspberry pi board
PDF
Getting Started with Raspberry Pi - DCC 2013.1
PPTX
Python-in-Embedded-systems.pptx
PDF
Getting Started with MicroPython and LoPy
PDF
Raspberry Pi 4.pdf
PPTX
Magnetic door lock using arduino
PPT
Raspberry Pi for IPRUG
DOCX
PPTX
Raspberry pi led blink
PPT
RaspberryPI PPT WITH ALL THE DETAILS OF PROGRAMMING
PDF
Ins and Outs of GPIO Programming
 
Python code for servo control using Raspberry Pi
1a Write the code using CircuitPython in Python Create a.pdf
Python in raspberry pi
Sensors, actuators and the Raspberry PI using Python
4. GPIO Access
Getting Started With Raspberry Pi - UCSD 2013
Getting Started with Raspberry Pi - USC 2013
[5]投影片 futurewad樹莓派研習會 141218
Introduction to Raspberry Pi and GPIO
Intro to the raspberry pi board
Getting Started with Raspberry Pi - DCC 2013.1
Python-in-Embedded-systems.pptx
Getting Started with MicroPython and LoPy
Raspberry Pi 4.pdf
Magnetic door lock using arduino
Raspberry Pi for IPRUG
Raspberry pi led blink
RaspberryPI PPT WITH ALL THE DETAILS OF PROGRAMMING
Ins and Outs of GPIO Programming
 
Ad

Recently uploaded (20)

PPTX
Chapter 5: Probability Theory and Statistics
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPT
What is a Computer? Input Devices /output devices
PDF
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
PPTX
Tartificialntelligence_presentation.pptx
PPTX
1. Introduction to Computer Programming.pptx
PDF
Architecture types and enterprise applications.pdf
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
STKI Israel Market Study 2025 version august
PPTX
cloud_computing_Infrastucture_as_cloud_p
PDF
Web App vs Mobile App What Should You Build First.pdf
PDF
Getting Started with Data Integration: FME Form 101
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
Zenith AI: Advanced Artificial Intelligence
PDF
Developing a website for English-speaking practice to English as a foreign la...
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
Enhancing emotion recognition model for a student engagement use case through...
PPTX
Programs and apps: productivity, graphics, security and other tools
Chapter 5: Probability Theory and Statistics
Univ-Connecticut-ChatGPT-Presentaion.pdf
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
Group 1 Presentation -Planning and Decision Making .pptx
What is a Computer? Input Devices /output devices
2021 HotChips TSMC Packaging Technologies for Chiplets and 3D_0819 publish_pu...
Tartificialntelligence_presentation.pptx
1. Introduction to Computer Programming.pptx
Architecture types and enterprise applications.pdf
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
STKI Israel Market Study 2025 version august
cloud_computing_Infrastucture_as_cloud_p
Web App vs Mobile App What Should You Build First.pdf
Getting Started with Data Integration: FME Form 101
A contest of sentiment analysis: k-nearest neighbor versus neural network
Zenith AI: Advanced Artificial Intelligence
Developing a website for English-speaking practice to English as a foreign la...
observCloud-Native Containerability and monitoring.pptx
Enhancing emotion recognition model for a student engagement use case through...
Programs and apps: productivity, graphics, security and other tools

Script

  • 1. #!/usr/bin/python import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) # init list with pin numbers pinList = [2, 3, 4, 17, 27, 22, 10, 9] # loop through pins and set mode and state to 'low' for i in pinList: GPIO.setup(i, GPIO.OUT) GPIO.output(i, GPIO.HIGH) # time to sleep between operations in the main loop SleepTimeL = 2 # main loop try: GPIO.output(2, GPIO.LOW) print "ONE" time.sleep(SleepTimeL); GPIO.output(3, GPIO.LOW) print "TWO" time.sleep(SleepTimeL); GPIO.output(4, GPIO.LOW) print "THREE" time.sleep(SleepTimeL); GPIO.output(17, GPIO.LOW) print "FOUR" time.sleep(SleepTimeL); GPIO.output(27, GPIO.LOW) print "FIVE" time.sleep(SleepTimeL); GPIO.output(22, GPIO.LOW) print "SIX" time.sleep(SleepTimeL); GPIO.output(10, GPIO.LOW) print "SEVEN" time.sleep(SleepTimeL); GPIO.output(9, GPIO.LOW) print "EIGHT" time.sleep(SleepTimeL); GPIO.cleanup() print "Good bye!" # End program cleanly with keyboard except KeyboardInterrupt: print " Quit" # Reset GPIO settings GPIO.cleanup() # find more information on this script at # http://youtu.be/oaf_zQcrg7g