from machine import ADC,Pin
import utime
from time import sleep

bt1 = Pin(13,Pin.IN,Pin.PULL_UP);
bt2 = Pin(14,Pin.IN,Pin.PULL_UP);
bt3 = Pin(15,Pin.IN,Pin.PULL_UP);

Op1 = Pin(0,Pin.IN,Pin.PULL_UP);
Op2 = Pin(1,Pin.IN,Pin.PULL_UP);
Op3 = Pin(2,Pin.IN,Pin.PULL_UP);

L1=Pin(16,Pin.OUT);
L2=Pin(17,Pin.OUT);
L3=Pin(18,Pin.OUT);

tiempo = 400;

while True:
#----------------------------------------------
    if bt1.value()==0: # desplazamiento izquierda
        print ("SECUENCIA 1");
        L1(1);L2(0);L3(0);utime.sleep_ms(tiempo);
        L1(0);L2(1);L3(0);utime.sleep_ms(tiempo);
        L1(0);L2(0);L3(1);utime.sleep_ms(tiempo);
        L1(1);L2(0);L3(0);utime.sleep_ms(tiempo);
#------------------------------------------------
    elif bt2.value()==0: #desplazamiento derecha
        print ("SECUENCIA 2");
        L1(0);L2(0);L3(1);utime.sleep_ms(tiempo);
        L1(0);L2(1);L3(0);utime.sleep_ms(tiempo);
        L1(1);L2(0);L3(0);utime.sleep_ms(tiempo);
        L1(0);L2(0);L3(1);utime.sleep_ms(tiempo);
    elif bt3.value()==0: #parpadeo todos
        print ("SECUENCIA 3");
        L1(1);L2(1);L3(1);utime.sleep_ms(tiempo);
        L1(0);L2(0);L3(0);utime.sleep_ms(tiempo);
        L1(1);L2(1);L3(1);utime.sleep_ms(tiempo);
        L1(0);L2(0);L3(0);utime.sleep_ms(tiempo);
    else:
        L1(0);L2(0);L3(0);
        
    if Op1.value()==0: # Suma
        print ("SUMA DE DOS NUMEROS");
        A = input (" Ingrese A:");
        B = input(" Ingrese B:" );
        print ("A + B =", int (A)+int(B));
    elif Op2.value()==0: #Resta
        print ("RESTA DE DOS NUMEROS");
        A = input (" Ingrese A:");
        B = input(" Ingrese B:" );
        print ("A - B =", int (A)-int(B));
    elif Op3.value()==0: #Multiplicacion
        print ("MULTIPLICACION DE DOS NUMEROS");
        A = input (" Ingrese A:");
        B = input(" Ingrese B:" );
        print ("A x B =", int (A)*int(B));
    else:
        L1(0);L2(0);L3(0);



BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT