Super useful project! The hardest part getting things to mount on curved surfaces. Ended up needing to 3D print the shafts that spin the dispenser flapper thing, and I used Kydex to hold the servos in place and mount the Raspberry Pi. 


Python code saved to desktop as feedKitties.py

import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)
GPIO.setwarnings(False)

GPIO.setup(2, GPIO.OUT)
GPIO.setup(4, GPIO.OUT)

servo_1 = GPIO.PWM(2, 50)
servo_2 = GPIO.PWM(4, 50)

servo_1.start(0)
servo_2.start(0)

servo_1.ChangeDutyCycle(12.5)
servo_2.ChangeDutyCycle(12.5)

time.sleep(.6)

servo_1.ChangeDutyCycle(0)
servo_2.ChangeDutyCycle(0)

To run the task twice a day I created a scheduled task using the crontab.

open terminal type:

crontab -e

Scroll to the very bottom and add this:

0 6 * * * python3 /home/Desktop/feedKitties.py
0 14 * * * sudo reboot
0 18 * * * python3 /home/Desktop/feedKitties.py

Now everyday at 6 am and 6pm it will feed my cats, and everyday at 2pm it will reboot itself.