Professional Documents
Culture Documents
INTEGRANTES:
ESPINOZA MONDRAGON, CARLOS
SALAZAR REYES, FLAVIO ENRIQUE
SANTAMARIA FERNANDEZ, JOSÉ LENNIN
DOCENTE:
AGUILAR ÑAÑEZ, JUAN
SEMESTRE:
2017 – II
FECHA:
22 DICIEMBRE DEL 2017
INFORME CIRCUITO PROYECTO FINAL CERRADURA
ELECTRONICA CON PC 16F877A
CODIGO PIC C
#include <16F877A.h> //Incluye la libreria del PIC
#fuses HS
#use delay(clock=4M) //Define la frecuencia con que se
trabajara
void main(void)
{
int item; //declaramos item
int n; // declarmos n
char k;
int i; //Inicializamos i
char data[4], clave[4]; //Espacio de memoria
lcd_init(); //inicializamos lcd
kbd_init(); //inicializamos el teclado
port_b_pullups(TRUE); //habilitamos resistencias de pullups
while(true) //ciclo infinito
{
CODIGO PIC C
#include <16f876a.h>
#fuses
XT,NOWDT,NOPUT,NOPROTECT,BROWNOUT,NOLVP,NOCPD,
NOWRT
#use delay (clock = 4000000)
#use standard_io(B)
void main()
{
while(1)
{
//if (input(PIN_B0)==0)
{
// delay_ms (40);
//caso 1
if (input(PIN_B0)==1)
{
output_high(PIN_B6); //enciende el led
//output_low(PIN_B1); //apaga el led
}
//caso 2
if (input(PIN_B1)==1)
{
output_low(PIN_B6); //apaga el led
}
//caso 3
if (input(PIN_B2)==1)
{
output_high(PIN_B7); //enciende el led
delay_ms (40);
output_low(PIN_B7); //apaga el led
}
//caso 4
if (input(PIN_B3)==1)
{
output_high(PIN_B6); //enciende el led
output_high(PIN_B7); //enciende el led
delay_ms (40);
output_low(PIN_B6); //apaga el led
output_low(PIN_B7); //apaga el led
}
//caso 5
if (input(PIN_B4)==1)
{
output_high(PIN_B6); //enciende el led
//output_low(PIN_B1); //apaga el led
output_high(PIN_B7); //enciende el led
//output_low(PIN_B2); //apaga el led
}
//caso 6
if (input(PIN_B5)==1)
{
//output_high(PIN_B1); //enciende el led
output_low(PIN_B6); //apaga el led
//output_high(PIN_B2); //enciende el led
output_low(PIN_B7); //apaga el led
}
}
}
}
CASO 1
CASO 2
CASO 5
CASO 6