update
This commit is contained in:
1 parent
67e253ccb6
commit
9df17e4ad7
3 files changed
+14
-3
No files matched your search
+1
-1
@@ -159,4 +159,4 @@ cython_debug/
|
|||||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
# 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.
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
#.idea/
|
#.idea/
|
||||||
.testled.py.swp
|
.*.swp
|
||||||
@@ -16,6 +16,11 @@ GPIO_3=5
|
|||||||
|
|
||||||
GPIO.setmode(GPIO.BOARD)
|
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):
|
def gpio_on (theGPIO):
|
||||||
# param1=INT # gpio#Nr
|
# param1=INT # gpio#Nr
|
||||||
GPIO.setup(theGPIO, GPIO.OUT)
|
GPIO.setup(theGPIO, GPIO.OUT)
|
||||||
@@ -34,3 +39,9 @@ def gpio_on_for (theGPIO, miliSec):
|
|||||||
gpio_on (theGPIO)
|
gpio_on (theGPIO)
|
||||||
sleep (miliSec)
|
sleep (miliSec)
|
||||||
gpio_off (theGPIO)
|
gpio_off (theGPIO)
|
||||||
|
|
||||||
|
def gpio_drive (thePWM,winkel):
|
||||||
|
thePWM.ChangeDutyCycle(winkel)
|
||||||
|
|
||||||
|
def zufall (a , b):
|
||||||
|
return 12
|
||||||
+2
-2
@@ -19,7 +19,7 @@ gpio_drive (beinMotor,0)
|
|||||||
#sleep (0.5)
|
#sleep (0.5)
|
||||||
|
|
||||||
# fussMotor einstellen auf zufallige (gueltige) - Position
|
# fussMotor einstellen auf zufallige (gueltige) - Position
|
||||||
winkel=zufall(27-113)
|
winkel=zufall(27,113)
|
||||||
gpio_drive (fussMotor,0)
|
gpio_drive (fussMotor,winkel)
|
||||||
#sleep (0.5)
|
#sleep (0.5)
|
||||||
|
|
||||||
Reference in new issue
Block a user