Code:
void keyscan() { RD0=1;RD1=1;RD2=1;RD3=1; if(SW1 != 1) { key=0;SW1=1;delay_ms(150);} if(SW2 != 1) { key=1;SW2=1;delay_ms(150);} if(SW3 != 1) { key=2;SW3=1;delay_ms(150);} if(SW4 != 1) { key=3;SW4=1;delay_ms(150);} if(key != 5) { switch (key) { case 0: {mode++;key = 5;blink=1;set_blink();} break; case 1: {change_time();key = 5;update_1307();} break; case 2: {clear_status();key = 5;} break; } } }
Comment