PortE problem?? PIC18F458

Status
Not open for further replies.
Try this code, it will work.

Code:
void main()
{
TRISE = 0X03;
PORTE.F2 = 0;
TRISC = 0x08;
CMCON = 0x07;
ADCON1 = 0b10000111;

while(1)
{
if(PORTE.F1 == 1) {
	Delay_ms(150);
		if(PORTE.F1 == 1)
 			PORTE.F2 = 0; //UP
}
if(PORTE.F0 == 1) {
	Delay_ms(150);
		if(PORTE.F0 == 1)
		 	PORTE.F2 = 0; //dn
}
if(PORTC.F3 == 1) {
	Delay_ms(150);
		if(PORTC.F3 == 1) {
			PORTE.F2 = 1; //ok
		}
}
}
}
 

Attachments

  • aboelle.rar
    13.3 KB · Views: 75
  • ss13.jpg
    165.9 KB · Views: 82
Last edited:

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…