0% found this document useful (0 votes)
79 views6 pages

Led Ligths Game: David Alexander López Manrique, Diego Andrés Garzón González

En este informe se muestra una práctica de laboratorio realizada por estudiantes , el objetivo de esta fue diseñar un "juedo de luces led" por medio de una señal dada a partir de un dipswitch que entra a un micro controlador programado.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views6 pages

Led Ligths Game: David Alexander López Manrique, Diego Andrés Garzón González

En este informe se muestra una práctica de laboratorio realizada por estudiantes , el objetivo de esta fue diseñar un "juedo de luces led" por medio de una señal dada a partir de un dipswitch que entra a un micro controlador programado.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

LED LIGTHS GAME

David Alexander López Manrique, Diego Andrés Garzón González


Dlopezma@unbosque.edu.co
Diego.garzon@gmail.com
Ingeniería electrónica, Universidad el Bosque

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

I. OBJETIVES proteus and the program is written in C


language.
General
To correctly implement the micro-controller III. MATERIALS
programmed with Pic C in a circuit that will be
able to perform the ignition sequence of the  Microcontroller Pic
LEDs depending on the requirements 16F877A.
described at the laboratory guide  Crystal 20Mhz
 2 capacitors of 22pf
 1 voltage regulator 7805
Specifics  LED diodes
 Resistors (150 Ω, 220Ω,
1. Correctly implement the electronic 330 Ω, 680 Ω, 1k Ω, 5k
configuration of the Pic Ω, 10k Ω.)
2. Simulate the previously mounted circuit  Dipswitch
 Protoboard.
3. Compile the proposed programming to
verify if the operation is efficient and will meet
the requirements IV. LAB PROCEDURE

II. INTRODUCTION Fist of all the schematic of the circuit is


done in proteus, also the program code is
At the practice the micro-controller had been
written for a previous test to the
used programmed by the students, the
implementation
objective is to perform ignition sequences of 8
LEDs depending on one signal given by a 4
posición switch, (1000, 0100, 0010, 0001). It
is important to stand out that the circuit The physical assembly proceeds to
simulation had been done previously in perform taking into account the electronic
configuration of the selected micro- delay_ms(100);
controller

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);

#byte trisb=0x86 delay_ms(250);

#byte portb=0x06 output_low(PIN_B3);


delay_ms(100);

int main (void)


{ output_high(PIN_B4);

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);

if(input(PIN_A0)==1 && delay_ms(100);


input(PIN_A1)==0 && input(PIN_A2)==0
&& input(PIN_A3)==0 ){
output_high(PIN_B6);
delay_ms(250);
output_high(PIN_B0);
output_low(PIN_B6);
delay_ms(250);
delay_ms(100);
output_low(PIN_B0);
delay_ms(100);
output_high(PIN_B7);
delay_ms(250); output_high(PIN_B5);
output_low(PIN_B7); delay_ms(250);
delay_ms(100); output_low(PIN_B5);
delay_ms(100);
}
output_high(PIN_B4);
else{ delay_ms(250);
output_low(PIN_B0); output_low(PIN_B4);
output_low(PIN_B1); delay_ms(100);
output_low(PIN_B2);
output_low(PIN_B3); output_high(PIN_B3);
output_low(PIN_B4); delay_ms(250);
output_low(PIN_B5); output_low(PIN_B3);
output_low(PIN_B6); delay_ms(100);
output_low(PIN_B7);
output_high(PIN_B2);
} delay_ms(250);
output_low(PIN_B2);
if(input(PIN_A0)==0 && delay_ms(100);
input(PIN_A1)==1 && input(PIN_A2)==0
&& input(PIN_A3)==0 ){
output_high(PIN_B1);

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

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy