# Proyecto: Clasificador Automatizado de Medicamentos
from machine import Pin, I2C, PWM
import ssd1306
import time
import tcs34725
import keypad_4x4
# MORADOS DE LOS SERVOS PWM
# CELESTES OLED SDA Y SCL
# LED PUENTE H
servo_rojo = PWM(Pin(27), freq=50, duty=0)
servo_verde = PWM(Pin(26), freq=50, duty=0)
servo_azul = PWM(Pin(25), freq=50, duty=0)
print('ola')
def angle_servo(servo, angle):
print('Yoyito')
minimum=26
maximum=128
dutyC = int(minimum+(angle/180)*(maximum-minimum))
servo.duty(dutyC)
print('no sirve')
while True:
print('NO FUNCA')
angle_servo(servo_azul, 90)
angle_servo(servo_rojo, 180)
angle_servo(servo_verde,0)
sleep(0.5)