diff --git a/.gitignore b/.gitignore index fb9f578..c45a278 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/inc/robot_inc.py b/inc/robot_inc.py index b0855aa..1d79498 100644 --- a/inc/robot_inc.py +++ b/inc/robot_inc.py @@ -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 diff --git a/robot-keeper.py b/robot-keeper.py index 12014b4..6700caa 100755 --- a/robot-keeper.py +++ b/robot-keeper.py @@ -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)