Page 263 - MDP2020-3
P. 263
················································································ 명장양성프로젝트 【MDP】 과제발표회 자료집 Ⅲ | 257
PORTC.1 = 1;
if (PINB.2 == 0&& PINB.3 ==0) {
PORTC.0 = 0;
PORTC.1 = 0;
break;
}
}
step = 2;
}
else if (step>2){
while (1){
PORTC.0 = 1;
PORTC.1 = 0;
if (PINB.2 == 0&& PINB.3 ==0) {
PORTC.0 = 0;
PORTC.1 = 0;
break;
}
}
step = 2;
}
}
void Step3(int compare) {
if (step<3){
while (1){
PORTC.0 = 0;
PORTC.1 = 1;
if (PINB.4 == 0&& PINB.5 ==0) {
PORTC.0 = 0;
PORTC.1 = 0;
break;
}
}
step = 3;
}
else if (step>3){
while (1){
PORTC.0 = 1;
PORTC.1 = 0;
if (PINB.4 == 0&& PINB.5 ==0) {
PORTC.0 = 0;