-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
55 lines (40 loc) · 1.02 KB
/
main.c
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
49
50
51
52
53
54
55
#include <stdio.h>
#include <unistd.h>
#include "elevation.h"
int main(int argc, char **argv)
{
int cabspshaft[1] = {1};//, 2};
tuple_range shaftsRange[1] = {0, 5};//{{0, 5}, {1, 7}};
elevation_init(1, cabspshaft, 8, shaftsRange);
elevation_cab_set_rest_floor(0, 0, 1);
printf("Initializing run loop...\n");
for (int i = 0; i < 100; ++i)
{
printf("Cabs location: {%d %d}",//,{%d %d},{%d %d}",
elevation_cab_get_floor(0, 0), elevation_cab_get_direction(0, 0));//,
// elevation_cab_get_floor(1, 0), elevation_cab_get_direction(1, 0),
// elevation_cab_get_floor(1, 1), elevation_cab_get_direction(1, 1));
switch (i)
{
case 0:
elevation_call_cab(5, 0, 0);
break;
case 3:
elevation_call_floor(2, 0, kElevationCabDirectionUp);
break;
case 4:
// elevation_call_cab(3, 1, 1);
// elevation_call_cab(0, 0, 0);
break;
case 10:
break;
case 12:
// elevation_call_cab(1, 0, 0);
break;
}
printf("\n");
sleep(1);
elevation_tick();
}
elevation_destroy();
}