This commit is contained in:
br committed 2023-01-07 07:47:18 +01:00
1 parent 67e253ccb6
commit 9df17e4ad7
3 files changed
+14 -3

No files matched your search

+1 -1
View File
@@ -159,4 +159,4 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.testled.py.swp
.*.swp
+11
View File
@@ -16,6 +16,11 @@ GPIO_3=5
GPIO.setmode(GPIO.BOARD)
GPIO.setup(32, GPIO.OUT)
GPIO.setup(31, GPIO.OUT)
bein_pwm=GPIO.PWM(32,1000)
fuss_pwm=GPIO.PWM(31,1000)
def gpio_on (theGPIO):
# param1=INT # gpio#Nr
GPIO.setup(theGPIO, GPIO.OUT)
@@ -34,3 +39,9 @@ def gpio_on_for (theGPIO, miliSec):
gpio_on (theGPIO)
sleep (miliSec)
gpio_off (theGPIO)
def gpio_drive (thePWM,winkel):
thePWM.ChangeDutyCycle(winkel)
def zufall (a , b):
return 12
+2 -2
View File
@@ -19,7 +19,7 @@ gpio_drive (beinMotor,0)
#sleep (0.5)
# fussMotor einstellen auf zufallige (gueltige) - Position
winkel=zufall(27-113)
gpio_drive (fussMotor,0)
winkel=zufall(27,113)
gpio_drive (fussMotor,winkel)
#sleep (0.5)