Files
robotik-WS-2022/testled.py
T
2023-01-06 21:47:02 +01:00

35 lines
918 B
Python
Executable File

#!/usr/bin/env python2
import RPi.GPIO as GPIO
import time
#phy_led = [8, 10, 12, 16, 18, 22, 24, 26, 32, 36, 38, 40,
# 37, 35, 33, 31, 29, 23, 21, 19, 15, 13, 11, 7, 5, 3];
phy_led = [8, 10, 12, 16, 18, 22, 26, 32, 36, 38, 40,
37, 35, 33, 31, 29, 23, 21, 15, 13, 11, 7, 5, 3];
print ('Pi Board Information')
print ('---------------------')
#for key,val in GPIO.RPI_INFO.items():
# print '%s => %s'%(key,val)
#response = raw_input('\nIs this board info correct (y/n) ? ').upper()
#17,18,27,22,23,24,25, 4, 2, 3, 8, 7,10, 9,11,14,15,28,29,30,31
GPIO_23=22
GPIO_17=16
GPIOTEST=27
GPIO.setmode(GPIO.BOARD)
#17,18,27,22,23,24,25, 4, 2, 3, 8, 7,10, 9,11,14,15,28,29,30,31
myLED=GPIOTEST
#while True:
for myLED in phy_led:
print '. on . ',myLED
GPIO.setup(myLED, GPIO.OUT)
GPIO.output(myLED,True)
time.sleep(0.5)
print '**off**',myLED
GPIO.output(myLED,False)
time.sleep(0.5)