Professional Documents
Culture Documents
Experiment 3 - Interfacing Analog Inputs
Experiment 3 - Interfacing Analog Inputs
Experiment 03 :
INTERFACING ANALOG INPUTS
• _____________________________
• _____________________________
• _____________________________
❖ SCENARIOS
SCENARIO 1 1
SCENARIO 2 1
Additional Components :
• 2 pcs. Light Emitting Diode (LED 0 - 1)
• 1 pc. Light Dependent Resistor ( LDR )
Initial Configuration :
➢ the display value must at 0.
➢ LED 0 is ON
➢ LED 1 is OFF
SCENARIO 3 1
Additional Component :
• 1 pc. toggle switch
• 1 pc. 10kΩ potentiometer
Initial Configuration :
➢ the display value start at 0.
➢ LED 0 state is ON.
➢ switch state is OFF.
I/O Components
• LED 2 0.5 watts L0 – L1 ----
• Seven Segment Display 1 0.5 watts SSD1 Common Cathode
• LDR 1 ---- LDR1 5mm
• 10kΩ Potientiometer 1 10kΩ P1 ----
• Toggle Switch 1 ---- S1 Push to ON – Normally Open
Others
• Breadboard 1 Full --- ---
• USB Data Cable 1 1m --- Type A Male to B Male
• Connecting Wires 30 10cm --- Male to Male
❖ HARDWARE CONNECTIONS
*insert the pictorial circuit diagram of SCENARIO 3 because it has all the
components used in this experiment.
Refer to the link below for the output experiment that can be simulated :
❖ SOURCE CODES
SCENARIO 1 1
INITIAL SOURCE CODE ( SCENARIO 1 )
Experiment 03
1 36
2 37
3 38
4 39
5 40
6 41
7 42
8 43
9 44
10 45
11 46
12 93
13 94
14 95
15 96
16 97
17 98
18 99
19 100
20 101
21 102
22 103
23 104
24 105
25 106
26 107
27 108
28 109
29 110
30 111
31 112
32 113
33 114
34 115
35 116
Experiment 1
1 36
2 37
3 38
4 39
5 40
6 41
7 42
8 43
9 44
10 45
11 46
12 93
13 94
14 95
15 96
16 97
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
SCENARIO 2 1
INITIAL SOURCE CODE ( SCENARIO 2 )
Experiment 03
1 36
2 37
3 38
4 39
5 40
6 41
7 42
8 43
9 44
10 45
11 46
12 93
13 94
14 95
15 96
16 97
17 98
18 99
19 100
20 101
21 102
22 103
23 104
24 105
25 106
26 107
27 108
28 109
29 110
30 111
31 112
32 113
33 114
34 115
35 116
Experiment 1
1 36
2 37
3 38
4 39
5 40
6 41
7 42
8 43
9 44
10 45
11 46
12 93
13 94
14 95
15 96
16 97
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
SCENARIO 3 1
INITIAL SOURCE CODE ( SCENARIO 3 )
Experiment 03
1 36
2 37
3 38
4 39
5 40
6 41
7 42
8 43
9 44
10 45
11 46
12 93
13 94
14 95
15 96
16 97
17 98
18 99
19 100
20 101
21 102
22 103
23 104
24 105
25 106
26 107
27 108
28 109
29 110
30 111
31 112
32 113
33 114
34 115
35 116
Experiment 1
1 36
2 37
3 38
4 39
5 40
6 41
7 42
8 43
9 44
10 45
11 46
12 93
13 94
14 95
15 96
16 97
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35