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

Jasonkam
Mon May 06 2024, 10:00 pm
JamesroW
Mon May 06 2024, 09:37 am
Chrispes
Mon May 06 2024, 07:34 am
ArktiTic
Sun May 05 2024, 07:06 pm
CesslasyNear
Sun May 05 2024, 02:58 pm
chimichmedic1204
Sun May 05 2024, 11:06 am
Jamiegob
Sun May 05 2024, 10:11 am
Gregoryjed
Sun May 05 2024, 10:02 am