Led Ligths Game: David Alexander López Manrique, Diego Andrés Garzón González
Led Ligths Game: David Alexander López Manrique, Diego Andrés Garzón González
Bogotá, Colombia
Abstract --- This laboratory expectation is to create a LED ligths game conducted by a micro
controller that will effect different ignition sequences of theirselves depending on the entrance
signal that they will recibe by a switch
output_high(PIN_B1);
The micro controller is programmed with delay_ms(250);
the written code and test are done
output_low(PIN_B1);
delay_ms(100);
V. RESULTS
Code:
output_high(PIN_B2);
#include <16F877A.h>
delay_ms(250);
#use delay(clock=20000000)
output_low(PIN_B2);
#fuses XT, NOWDT, NOBROWNOUT,
PUT, NOLVP, NOPROTECT delay_ms(100);
#byte trisa=0x85
#byte porta=0x05 output_high(PIN_B3);
TRISA=0b11110000; delay_ms(250);
TRISB=0b00000000; output_low(PIN_B4);
PORTA=0b00000000; delay_ms(100);
PORTB=0b00000000;
// Write your code here output_high(PIN_B5);
delay_ms(250);
While(true){ output_low(PIN_B5);
output_high(PIN_B7); delay_ms(250);
delay_ms(250); output_low(PIN_B1);
output_low(PIN_B7); delay_ms(100);
delay_ms(100);
output_high(PIN_B0);
output_high(PIN_B6); delay_ms(250);
delay_ms(250); output_low(PIN_B0);
output_low(PIN_B6); delay_ms(100);
} output_high(PIN_B1);
output_high(PIN_B6);
else{ delay_ms(250);
output_low(PIN_B0); output_low(PIN_B1);
output_low(PIN_B1); output_low(PIN_B6);
output_low(PIN_B2); delay_ms(100);
output_low(PIN_B3);
output_low(PIN_B4); output_high(PIN_B0);
output_low(PIN_B5); output_high(PIN_B7);
output_low(PIN_B6); delay_ms(250);
output_low(PIN_B7); output_low(PIN_B0);
output_low(PIN_B7);
} delay_ms(100);
if(input(PIN_A0)==0 && }
input(PIN_A1)==0 && input(PIN_A2)==1
&& input(PIN_A3)==0 ){
else{
output_high(PIN_B3); output_low(PIN_B0);
output_high(PIN_B4); output_low(PIN_B1);
delay_ms(250); output_low(PIN_B2);
output_low(PIN_B3); output_low(PIN_B3);
output_low(PIN_B4); output_low(PIN_B4);
delay_ms(100); output_low(PIN_B5);
output_low(PIN_B6);
output_high(PIN_B2); output_low(PIN_B7);
output_high(PIN_B5);
delay_ms(250); }
output_low(PIN_B2);
output_low(PIN_B5); if(input(PIN_A0)==0 &&
input(PIN_A1)==0 && input(PIN_A2)==0
delay_ms(100); && input(PIN_A3)==1 ){
output_high(PIN_B0); output_low(PIN_B0);
output_high(PIN_B7); output_low(PIN_B1);
delay_ms(250); output_low(PIN_B2);
output_low(PIN_B0); output_low(PIN_B3);
output_low(PIN_B7); output_low(PIN_B4);
delay_ms(100); output_low(PIN_B5);
output_low(PIN_B6);
output_high(PIN_B1); output_low(PIN_B7);
output_high(PIN_B6);
delay_ms(250); }
output_low(PIN_B1);
}
output_low(PIN_B6);
delay_ms(100);
return 0;
}
output_high(PIN_B2);
output_high(PIN_B5);
Schematic:
delay_ms(250);
output_low(PIN_B2);
output_low(PIN_B5);
delay_ms(100);
output_high(PIN_B3);
output_high(PIN_B4);
delay_ms(25);
output_low(PIN_B3);
output_low(PIN_B4);
VI. CONCLUSIONS
delay_ms(5);
After the laboratory procedure a
micro controllers Pic circuit
} managed to make it work
The programming after some
corrections and errors worked, to
else{
satisfy the needs of the laboratory
The performed proteus simulation
showed up some dificultes in the
connection of some componentes,
finally was solved