-
Notifications
You must be signed in to change notification settings - Fork 1
/
miniproject.LST
75 lines (66 loc) · 2.68 KB
/
miniproject.LST
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
C51 COMPILER V9.53.0.0 MINIPROJECT 04/16/2023 15:31:52 PAGE 1
C51 COMPILER V9.53.0.0, COMPILATION OF MODULE MINIPROJECT
OBJECT MODULE PLACED IN miniproject.OBJ
COMPILER INVOKED BY: C:\Keil_v5\C51\BIN\C51.EXE miniproject.c OPTIMIZE(8,SPEED) BROWSE DEBUG OBJECTEXTEND TABS(2)
line level source
1 #include<reg51.h>
2 sbit sensor1 = P1^0;
3 sbit sensor2 = P1^1;
4 sbit sensor3 = P1^2;
5 // sensors on street
6
7 sbit load1 = P2^0;
8 sbit load2 = P2^1;
9 sbit load3 = P2^2;
10 // street light connections
11
12 void main()
13 {
14 1 load1 = load2 = load3 = 0;
15 1 sensor1 = sensor2 = sensor3 = 0;// optional logic based on input
16 1
17 1 while (1)
18 1 {
19 2 if (sensor1 == sensor2 == sensor3 == 0)
20 2 {
21 3 load1 = 0; // street light 1 off
22 3 load2 = 0; // street light 2 off
23 3 load3 = 0; // street light 3 off
24 3 }
25 2 if (sensor1==1)
26 2 {
27 3 load1 = 1; // street light 1 on
28 3 load2 = 0; // street light 2 off
29 3 load3 = 0; // street light 3 off
30 3 }
31 2 if (sensor2==1)
32 2 {
33 3 load1 = 0; // street light 1 off
34 3 load2 = 1; // street light 2 on
35 3 load3 = 0; // street light 3 off
36 3 }
37 2 if (sensor3==1)
38 2 {
39 3 load1 = 0; // street light 1 off
40 3 load2 = 0; // street light 2 off
41 3 load3 = 1; // street light 3 on
42 3 }
43 2 if (sensor1 && sensor2 && sensor3 == 1)
44 2 {
45 3 load1 = 1; // street light 1 on
46 3 load2 = 1; // street light 2 on
47 3 load3 = 1; // street light 3 on
48 3 }
49 2 }
50 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 92 ----
CONSTANT SIZE = ---- ----
C51 COMPILER V9.53.0.0 MINIPROJECT 04/16/2023 15:31:52 PAGE 2
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)