#include<p18f4580.h>
#pragma config OSC=HS
#pragma config LVP=OFF
#define SW1 PORTBbits.RB2
#define LAMP PORTBbits.RB7
void main()
{
TRISB=0x04;
PORTB=0x00;
while(1)
{
if (SW1==0)
{
LAMP=0;
}
else
{
LAMP=1;
}
}
}
//IF SW=0 LAMP OFF, IF SW=1 LAMP ON
PUT YOUR CURSOR AT MENU BUTTON AND SCROLL UP DOWN