답변 : 초음파 센서로 LED 동작
페이지 정보
작성자 master 작성일18-12-04 22:05 조회6,696회 댓글0건본문
// MCU BASIC: https://www.basic4mcu.com
// DateTime : 2018-12-04 오후 10:10:42
// by Ok-Hyun Park
//
while(1){
range[0]=Echo1(); //들어가는거 //차단
if(range[0]<30){
if(MAX-count>=1){
PORTB|=1; _delay_ms(500); PORTB&=~1;
svangle1( 0); _delay_ms(500);
svangle1(90); _delay_ms(500);
count++;
}
}
//
range[1]=Echo2(); //나가는거
if(range[1]<30){
if(count>=1){
PORTB|=4; _delay_ms(500); PORTB&=~4;
svangle2( 0); _delay_ms(500);
svangle2(90); _delay_ms(500);
count--;
}
}
댓글 : 0
조회수 : 6,696
등록된 댓글이 없습니다.