-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhw7.c
More file actions
48 lines (36 loc) · 1.19 KB
/
Copy pathhw7.c
File metadata and controls
48 lines (36 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <stdio.h>
void main() {
int obstacle_Location;
bool dust_Existence;
while (1) { // 장애물 감지
obstacle_Location = Det_OL();
dust_Existence = Det_DE();
if ()
wait(200ms);
}
}
/*
int Wheel
1 // 전진
0 //정지
-1 // 후진
int Cleaner
1 // 청소 실시
0 // 청소 중지
CleanerPower() >> 상태에 따라 Cleaner = 1 || Cleaner = 0;
MoveForward() >> Wheel = 1 // 전진상태로 변환합니다.
MoveBackward() >> Wheel = -1 // 후진상태로 변환합니다.
TurnLeft() >> print("좌측으로 회전합니다")
WaitTickForTurning = 5
if(WaitTickForTurning > 0) WaitTickForTurning--
회전중.. 출력하고 wait(200ms)
// Tick * 5번 동안은 while문에 들어왔을때 TurnLeft함수안으로들어가서
// TurnLeft함수 내부에서 조작을 하고 (WaitTickForTurning가 0이 되면
// 정상적으로 다음 while 루프진행
while() 안에서
WaitTickForTurning >0 상태라면 TurnLeft() 함수 재호출
TurnRight() >> print("우측으로 회전합니다")
WaitTickForTurning = 5
if(WaitTickForTurning > 0) WaitTickForTurning--
회전중.. 출력하고 wait(200ms)
*/