You are on page 1of 4

#include <18F4550.

h>
#fuses XT
#use delay(clock=4MHz)
#include <Flex_LCD420.c>
#include <funciones.c>
#int_RB

void todo(void);
void presentacion(void);

void todo(void){
while(b==1){
lcd_putc("\f");
menu();
if(!input(PIN_A0)){
int a=0;
while(a==0)
menu1();
}
if(!input(PIN_A1)){
int a=0;
while(a==0)
menu2a();}

}
}
void presentacion(void)
{
lcd_gotoxy(3,1);
lcd_putc("OXIGENADOR UPS");
lcd_gotoxy(2,3);
lcd_putc("by. Jimmy Pinoargote");
lcd_gotoxy(2,4);
lcd_putc("by. Erwin Bustamante");
delay_ms(2000);
lcd_putc("\f");
}
int t0=0;
int16 t=0;
int b=1;
int parte;

void menu(void);

void menu1(void);
void menu2(void);
void menu2a(void);
void menu3(void);
void menu3a(void);

void menu(void)
{

lcd_putc("\fSELECCIONE");
lcd_gotoxy(1,2);
lcd_putc("A) POR TIEMPO");
lcd_gotoxy(1,3);
lcd_putc("B) ASISTIDO");
delay_ms(2000);
lcd_putc("\f");
}

void menu1(void)
{

lcd_putc("\fSELECCIONE TIEMPO");
lcd_gotoxy(1,2);
lcd_putc("A) 10s B) 20s");
lcd_gotoxy(1,3);
lcd_putc("C) 30s D) 40s");
delay_ms(2000);
lcd_putc("\f");
if(!input(PIN_A0)){
int a=0;
t=10000;
t0=10;
while(a==0)
menu2();
}
if(!input(PIN_A1)){
int a=0;
t=20000;
t0=20;
while(a==0)
menu2();
}
if(!input(PIN_A2)){
int a=0;
t=30000;
t0=30;
while(a==0)
menu2();
}
if(!input(PIN_A3)){
int a=0;
t=40000;
t0=40;
while(a==0)
menu2();
}
if (!input(PIN_A5)){
reset_cpu();
}
}

void menu2(void)
{

lcd_putc("\fSELECCIONE");
lcd_gotoxy(1,2);
lcd_putc("A) CARA B) MANOS");
lcd_gotoxy(1,3);
lcd_putc("C) BRAZOS D) PIERNAS");
delay_ms(2000);
lcd_putc("\f");

if(!input(PIN_A0)){
int a=0;
parte=1;
while(a==0)
menu3();
}
if(!input(PIN_A1)){
int a=0;
parte=2;
while(a==0)
menu3();
}
if(!input(PIN_A2)){
int a=0;
parte=3;
while(a==0)
menu3();
}
if(!input(PIN_A3)){
int a=0;
parte=4;
while(a==0)
menu3();
}
if(!input(PIN_A5)){
reset_cpu(); }

}
void menu2a(void)
{

lcd_putc("\fSELECCIONE");
lcd_gotoxy(1,2);
lcd_putc("A) CARA B) PIERNAS");
lcd_gotoxy(1,3);
lcd_putc("C) BRAZOS D) MANOS");
delay_ms(1000);
lcd_putc("\f");

if(!input(PIN_A0)){
int a=0;
parte=1;
while(a==0)
menu3a();
}
if(!input(PIN_A1)){
int a=0;
parte=2;
while(a==0)
menu3a();
}
if(!input(PIN_A2)){
int a=0;
parte=3;
while(a==0)
menu3a();
}
if(!input(PIN_A3)){
int a=0;
parte=4;
while(a==0)
menu3a();
}
if(!input(PIN_A5)){
reset_cpu(); }

}
void menu3(void)
{

lcd_putc("\fSELECCIONE");
lcd_gotoxy(1,2);
lcd_putc("A) CONTINUO ");
lcd_gotoxy(1,3);
lcd_putc("B) PULSANTE ");
delay_ms(2000);
lcd_putc("\f");
if(!input(PIN_A0)){
int cont=1;

void main()
{
set_tris_c(0x00);
set_tris_b(0xff);
b=1;
lcd_init();
set_tris_a(0x0f);
presentacion();
while(true)
{
todo();
}}

You might also like