Code in echten Code konvertiert

This commit is contained in:
ub committed 2023-01-06 23:57:37 +01:00
1 parent b93d6f65fa
commit f72538fc63
2 files changed
+30 -15

No files matched your search

+14 -8
View File
@@ -1,8 +1,10 @@
#!/usr/bin/env python2
import RPi.GPIO as GPIO
import time
#-*- coding:utf-8 -*-
valid_led = [32,15,31,22,3,5];
import RPi.GPIO as GPIO
from time import sleep
valid_led = [32,15,31,22,3,5]
GPIO_23=22
GPIO_17=32
@@ -13,16 +15,20 @@ GPIO_2=3
GPIO_3=5
def gpio_on (theGPIO):
# param1=INT # gpio#Nr
# param1=INT # gpio#Nr
GPIO.setup(theGPIO, GPIO.OUT)
GPIO.output(theGPIO,True) # lamp on
# print "GPIO.setup(" + str(theGPIO) + ", GPIO.OUT)"
GPIO.output(theGPIO,True) # lamp on
# print "GPIO.output(" + str(theGPIO) + ",True)" # lamp on
def gpio_off (theGPIO):
# param1=INT # gpio#Nr
# param1=INT # gpio#Nr
GPIO.setup(theGPIO, GPIO.OUT)
GPIO.output(theGPIO,False) # lamp on
GPIO.output(theGPIO,False) # lamp off
# 50 milliseconds = miliSec = 0.05
def gpio_on_for (theGPIO, miliSec):
gpio_on (theGPIO)
sleep miliSec
sleep (miliSec)
gpio_off (theGPIO)