#define SW P0 //Define Switch to Port0 #define Led P0 //Define Led to Port0 void main() { // P=0xff; //Port-0 as input to FFh //P0=0x00; //Port-0 as output to 00h while(1) //Loop Forever { Led = SW; //Assign the Switch value to Led } }
For More Tutorials www.pantechsolutions.net http://www.slideshare.net/pantechsolutions http://www.scribd.com/pantechsolutions http://www.youtube.com/pantechsolutions