Files
robotik-WS-2022/inc/robot-inc.py
T
2023-01-06 22:16:54 +01:00

29 lines
515 B
Python

#!/usr/bin/env python2
import RPi.GPIO as GPIO
import time
valid_led = [32,15,31,22,3,5];
GPIO_23=22
GPIO_17=32
GPIO_18=15
GPIO_27=31
GPIO_23=22
GPIO_2=3
GPIO_3=5
def gpio_on (theGPIO):
# param1=INT # gpio#Nr
GPIO.setup(theGPIO, GPIO.OUT)
GPIO.output(theGPIO,True) # lamp on
def gpio_off (theGPIO):
# param1=INT # gpio#Nr
GPIO.setup(theGPIO, GPIO.OUT)
GPIO.output(theGPIO,False) # lamp on
def gpio_on_for (theGPIO, miliSec):
gpio_on (theGPIO)
sleep miliSec
gpio_off (theGPIO)