// Aca configuracion de puertos
int contador=0;
while(1)
{
if (input(PIN_A1))
{
delay_ms(50); // Aca entra si detecto algo
contador++;
if(contador==10)
{
output_low(PIN_B0);
output_high(PIN_B2);
contador=0;
}
while(input(PIN_A1)); // Cuenta 1 pero no sale hasta que se suelte el boton
}
if (input(PIN_A2))
{
output_low(PIN_B0);
output_high(PIN_B1);
}
if (input(PIN_A0))
{
output_high(PIN_B1);
}
}