Discussion in "PIC Microcontroller Discussion" started by    cezar    Jul 22, 2008.
Tue Jul 22 2008, 04:08 am
#1
#include<pic.h>

int B,C,D;
int decode[10]={0,1,2,3,4,5,6,7,8,9};

main()
{
TRISA=0xFF;
TRISE=0x0F;
TRISB=0x00;
TRISC=0x00;
TRISD=0x00;
while(1)
{
if (RA0==1||RE0==1){B=10;PORTB=decode[b];PORTC=decode[C];PORTD=decode[D];}
if (RA1==1||RE1==1){B=1;PORTB=decode[b];PORTC=decode[C];PORTD=decode[D];}
if (RA2==1||RE2==1){C=2;PORTB=decode[b];PORTC=decode[C];PORTD=decode[D];}
if (RA3==1){C=3;PORTB=decode[b];PORTC=decode[C];PORTD=decode[D];}
if (RA4==1){D=4;PORTB=decode[b];PORTC=decode[C];PORTD=decode[D];}
if (RA5==1){D=5;PORTB=decode[b];PORTC=decode[C];PORTD=decode[D];}
}


}
Tue Jul 22 2008, 08:54 pm
#2
is it the complete program?

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

scaneraNom
Sat May 04 2024, 02:21 am
gtaletrzua
Fri May 03 2024, 10:55 am
Clydehet
Wed May 01 2024, 06:44 pm
Davidoried
Wed May 01 2024, 06:11 pm
KevinTab
Sun Apr 28 2024, 05:35 am
Tumergix
Sun Apr 28 2024, 12:59 am
StevenDrulk
Sat Apr 27 2024, 08:47 pm
StephenHauct
Sat Apr 27 2024, 09:38 am