메뉴 바로가기
서브메뉴 바로가기
본문 바로가기
혹시 위에 올리신게 분리시키신 것인지요?.. 일단 저렇게 하면 icounter == 3 이. ,blink 모드일때 800이후에 다시 들어오기때문에.. else{SEGM =fnd_data[icounter];} fnd와 icounter==7 일때 led 그룹이 제대로 들어오지 않게 됩니다.그래서...제가 이런식으로도 해봤는데, 스위치 누르면 이상하케 led들이 들어오고 이상한 것이 깜빡이고 난리납니다.--'void Disp_operation(void) { if(Disp_timer>0) return; Disp_timer =2; if(++icounter ==8) icounter=0; DIGM = 1<<icounter; //////////////////////////// if(icounter == 3){ if(blink_flag !=0) return; else { SEGM = Led_one; } } ////////////////////////////// else if(icounter == 7){ if(blink_flag !=0) return; else { SEGM = Led_two; } } //////////////////////////////// else{SEGM =fnd_data[icounter];} //else SEGM =fnd_data[icounter];}
void Disp_suboperation(void) { if(LED_timer>0) return; LED_timer =2; //////////////////////////// if(icounter == 3){ DIGM = 1<<icounter; if(blink_flag >0 && blink_flag < 9){ LED_timer = 800; if(LEDST[blink_flag-1]==1){ //LED OFF Led_one = Led_one & ~(1<<(blink_flag-1));//ON SEGM = Led_one;} else if(LEDST[blink_flag-1]==0) { //LED ON Led_one = Led_one | (1<<(blink_flag-1));//OFF SEGM = Led_one;} } else return; } ////////////////////////////// else if(icounter== 7){ DIGM = 1<<icounter; if(blink_flag >8){ LED_timer = 800; if(LEDST[blink_flag-1]==1){ //LED OFF Led_two = Led_two & ~(1<<(13-blink_flag));//ON SEGM = Led_two;} else if(LEDST[blink_flag-1]==0) { //LED ON Led_two = Led_two | (1<<(13-blink_flag));//OFF SEGM = Led_two;} } else return; } ////////////////////////////////} while(1) {Disp_operation();Disp_suboperation();SW_operation();
if(SwInput()==4)LedDisp(12,2); //스위치 입력값이 4이면, 12번째 led만 깜빡 깜빡해라.. 스위치 입력값은 정상으로 들어오는데..--
}}
여기에 파일을 끌어 놓거나 왼쪽의 버튼을 클릭하세요.
파일 용량 제한 : 0MB (허용 확장자 : *.*)
업로드 중... (0%)
혹시 위에 올리신게 분리시키신 것인지요?.. 일단 저렇게 하면 icounter == 3 이. ,blink 모드일때 800이후에 다시 들어오기
때문에..
else{SEGM =fnd_data[icounter];} fnd와 icounter==7 일때 led 그룹이 제대로 들어오지 않게 됩니다.
그래서...제가 이런식으로도 해봤는데, 스위치 누르면 이상하케 led들이 들어오고 이상한 것이 깜빡이고 난리납니다.--'
void Disp_operation(void) {
if(Disp_timer>0) return;
Disp_timer =2;
if(++icounter ==8) icounter=0;
DIGM = 1<<icounter;
////////////////////////////
if(icounter == 3){
if(blink_flag !=0) return;
else {
SEGM = Led_one; }
}
//////////////////////////////
else if(icounter == 7){
if(blink_flag !=0) return;
else {
SEGM = Led_two; }
}
////////////////////////////////
else{SEGM =fnd_data[icounter];}
//else SEGM =fnd_data[icounter];
}
void Disp_suboperation(void) {
if(LED_timer>0) return;
LED_timer =2;
////////////////////////////
if(icounter == 3){
DIGM = 1<<icounter;
if(blink_flag >0 && blink_flag < 9){
LED_timer = 800;
if(LEDST[blink_flag-1]==1){ //LED OFF
Led_one = Led_one & ~(1<<(blink_flag-1));//ON
SEGM = Led_one;}
else if(LEDST[blink_flag-1]==0) { //LED ON
Led_one = Led_one | (1<<(blink_flag-1));//OFF
SEGM = Led_one;}
}
else return;
}
//////////////////////////////
else if(icounter== 7){
DIGM = 1<<icounter;
if(blink_flag >8){
LED_timer = 800;
if(LEDST[blink_flag-1]==1){ //LED OFF
Led_two = Led_two & ~(1<<(13-blink_flag));//ON
SEGM = Led_two;}
else if(LEDST[blink_flag-1]==0) { //LED ON
Led_two = Led_two | (1<<(13-blink_flag));//OFF
SEGM = Led_two;}
}
else return;
}
////////////////////////////////
}
while(1) {
Disp_operation();
Disp_suboperation();
SW_operation();
if(SwInput()==4)LedDisp(12,2); //스위치 입력값이 4이면, 12번째 led만 깜빡 깜빡해라.. 스위치 입력값은 정상으로 들어오는데..--
}
}