hi i need some help in implementing LED and push button | Microcontroller › PIC › hi i need some help in implementing LED and push button This topic has 4 replies, 4 voices, and was last updated 9 years, 7 months ago by Hashwanth. Viewing 5 posts - 1 through 5 (of 5 total) Author Posts August 21, 2014 at 6:50 am #3166 HashwanthParticipant hi i’m very new to controller and i’m trying myself with pic16f877A. here is my doubt, when i deal with push button and LED, i have some trouble in switching my LED’s off, i need to on and off the LED by using same button,here is my code. can anyone please help me solve this issue,, void lcd_cmd(char a); void lcd_disp(char b); void main() { char a[]={“LED1 ON led2off”}; char a1[]={“LED3 OFF”}; char b[]=”LED1OFF LED2ON”; char c[]=”LED1OFF LED2OFF”; char d[]=”LED3 ON”; int i; char x; setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); setup_psp(PSP_DISABLED); setup_spi(FALSE); setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); setup_timer_1(T1_DISABLED); setup_timer_2(T2_DISABLED,0,1); setup_comparator(NC_NC_NC_NC); setup_vref(FALSE); // TODO: USER CODE!! lcd_cmd(0x01); lcd_cmd(0x06); lcd_cmd(0x0e); lcd_cmd(0x38); while(1) { lcd_cmd(0x80); switch(1) { case 1: if(input(pin_c0)==0) { output_low(pin_d7); delay_ms(10); lcd_cmd(0x01); delay_ms(10); for(i=0;a!=’