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

RodneyKnorb
Thu Apr 25 2024, 07:08 pm
Williamjef
Thu Apr 25 2024, 02:08 pm
SamuelSmise
Thu Apr 25 2024, 09:56 am
DustinErele
Thu Apr 25 2024, 08:44 am
ztaletpzca
Wed Apr 24 2024, 11:19 pm
IrardlPex
Wed Apr 24 2024, 08:42 pm
Charlestehed
Wed Apr 24 2024, 05:20 pm
Robertgurse
Wed Apr 24 2024, 02:43 pm