Skip to content

Commit

Permalink
C code updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Edgar-La authored Oct 2, 2020
1 parent 4f41e16 commit 70e4e04
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Drill-machine/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,27 @@ int main(void)



int tr = 10000;
int tr = 30000;
for(;;) //Ciclo infinito
{
iniciar_proceso(); //Espera hasta que se oprima boton inicio
P2OUT = 0b00001000; //Comienza BR
delay(tr+4000);
iniciar_proceso(); //Espera hasta que se oprima boton inicio
//P1OUT = 0b0010; //Sensor 'a'
//delay(tr);

P1OUT = 0b00000100; //LLega a sensor b y
P2OUT = 0b1000; //Comienza BR
delay(tr);

P1OUT = 0b0100; //LLega a sensor b y
P2OUT = 0b00010010; // activo Rele y bajanda lenta
delay(tr);

P1OUT = 0b00001000; //Sensor c
P1OUT = 0b1000; //Sensor c
P2OUT = 0b0000011; //Subida rapida y sigue activo rele.
delay(tr);

P1OUT = 0b00000010; //Se activa sensor a
P2OUT = 0b00000000; //Detengo subida rapida y rele.
delay(tr + 500);
delay(tr);

P1OUT = 0b00000000; //Apago sensor a
senal_acustica(); //Inicia senal acustica
Expand Down Expand Up @@ -69,8 +72,8 @@ void senal_acustica()
for (sound = 1; sound <= 5; sound++)
{
P1OUT = 0b00100000; //Enciende señal acustica
delay(3000);
delay(4000);
P1OUT = 0b00000000; //Apaga señal acustica
delay(2000);
delay(3000);
}
}

0 comments on commit 70e4e04

Please sign in to comment.