Experiment Template - Micro LATEST
Experiment Template - Micro LATEST
Presented by:
[ GROUP NAME ]
Leader : [ Name of Leader ( LN, FN, MI ) ]
Members :
[ Name of Members in Alphabetical Order ( LN, FN, MI ) ]
PROCEDURE ANSWERS
*If the given experiment has procedure questions, put your answers here.
ACTIVITY DETAILS
SCENARIOS
*Discuss given problem / scenarios here..
SCENARIO 01
Conditions :
the potentiometer controls the transition speed of the Running Light.
SCENARIO 02
Conditions :
the potentiometer controls the transition speed of the Running Light.
SCENARIO nth
Conditions :
blah blah blah….
*itemize all the components and devices used in the experiment in general.
I/O Components
LED Array 1 0.5 watts L0 – L7 8 LEDs in an Array
Seven Segment 1 0.5 watts SSD1 Common Anode
Display
10kΩ Potientiometer 1 10kΩ P1 ----
Momentary 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
*List the connections used in the experiment. Since the exercises / scenario is progressive, use the
setup and connection of the last exercise / scenario only.
*state the initial conditions of the hardware for each scenario here
SCENARIO 01
SSD1 is set to zero.
S1 is set to OFF.
P1 is set halfway.
Running Light LED transition activated.
SCENARIO 02
SSD1 is set to zero.
S1 is set to OFF.
P1 is set halfway.
Running Light LED transition activated.
SCENARIO NTH
SSD1 is set to zero.
S1 is set to OFF.
P1 is set halfway.
Running Light LED transition activated.
* Since the exercises / scenario is progressive, use the setup and connection of the last exercise / scenario
only.
*insert schematic circuit diagram here complete with proper labels and
symbols
* Since the exercises / scenario is progressive, use the ACTUAL setup and connection of the last exercise /
scenario only.
SOURCE CODES
SCENARIO 01
SCENARIO DESCRIPTION
Conditions :
the potentiometer controls the transition speed of the Running Light.
INITIAL CODES
*your group’s basic raw source code as long as it is working and complies with all the requirements.
*it is ok for the codes here if it is not yet optimized and full of user comments
Experiment 1
{ for(int y = sPin; y<=ePin && flag==0; y+
1 int A = A3; 36
+)
2 int B = A2; 37 { digitalWrite(y,HIGH);
3 int C = A1; 38 delay(tDelay);
4 int D = A0; 39
5 40 switchData = digitalRead(switchPin);
6 int sPin = 2; 41 if(switchData == 1)
7 int ePin = 10; 42 { while(switchData == 1)
{ switchData =
8 43
digitalRead(switchPin);
9 int potPin = A4; 44 }
10 45 val = y - 1;
11 int switchPin = 11; 46 flag = 1;
12 93 break;
13 int flag = 0; 94 }
14 int tDelay = 0; 95 allLEDOff();
15 int val = 0; 96 }
16 int switchData = 0; 97
17 98 for(int z = ePin; z>=sPin && flag==0; z--)
18 void setup() 99 { digitalWrite(z,HIGH);
10
19 { pinMode(A, OUTPUT); delay(tDelay);
0
10
20 pinMode(B, OUTPUT);
1
10
21 pinMode(C, OUTPUT); switchData = digitalRead(switchPin);
2
10
22 pinMode(D, OUTPUT); if(switchData == 1)
3
10
23 { while(switchData == 1)
4
10 { switchData =
24 for(int x = sPin; x<=ePin; x++)
5 digitalRead(switchPin);
10
25 { pinMode(x,OUTPUT); }
6
10
26 } val = z - 1;
7
10
27 flag = 1;
8
10
28 Serial.begin(9600); break;
9
11
29 } }
0
11
30 allLEDOff();
1
11
31 void loop() }
2
11
32 { tDelay = analogRead(potPin); }
3
33 switchData = digitalRead(switchPin); 11
Submitted to : ENGR. RAFAEL A. VENTURA
NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT
4
11
34 if(switchData == 1) void allLEDOff()
5
11
35 { while(switchData == 1) { for(int a = sPin; a <=ePin; a++)
6
OPTIMIZED CODES
*code, process, memory, etc. optimization techniques are already applied in the source code.
Experiment 1
{ for(int y = sPin; y<=ePin && flag==0; y+
1 int A = A3; 36
+)
2 int B = A2; 37 { digitalWrite(y,HIGH);
3 int C = A1; 38 delay(tDelay);
4 int D = A0; 39
5 40 switchData = digitalRead(switchPin);
6 int sPin = 2; 41 if(switchData == 1)
7 int ePin = 10; 42 { while(switchData == 1)
{ switchData =
8 43
digitalRead(switchPin);
9 int potPin = A4; 44 }
10 45 val = y - 1;
11 int switchPin = 11; 46 flag = 1;
12 93 break;
13 int flag = 0; 94 }
14 int tDelay = 0; 95 allLEDOff();
15 int val = 0; 96 }
16 int switchData = 0; 97
17
18 void setup()
19 { pinMode(A, OUTPUT);
20 pinMode(B, OUTPUT);
21 pinMode(C, OUTPUT);
22 pinMode(D, OUTPUT);
23
24 for(int x = sPin; x<=ePin; x++)
25 { pinMode(x,OUTPUT);
26 }
27
28 Serial.begin(9600);
29 }
30
31 void loop()
Submitted to : ENGR. RAFAEL A. VENTURA
NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT
32 { tDelay = analogRead(potPin);
33 switchData = digitalRead(switchPin);
34 if(switchData == 1)
35 { while(switchData == 1)
SCENARIO 02
SCENARIO DESCRIPTION
Conditions :
the potentiometer controls the transition speed of the Running Light.
INITIAL CODES
*your group’s basic raw source code as long as it is working and complies with all the requirements.
*it is ok for the codes here if it is not yet optimized and full of user comments
Experiment 1
{ for(int y = sPin; y<=ePin && flag==0; y+
1 int A = A3; 36
+)
2 int B = A2; 37 { digitalWrite(y,HIGH);
3 int C = A1; 38 delay(tDelay);
4 int D = A0; 39
5 40 switchData = digitalRead(switchPin);
6 int sPin = 2; 41 if(switchData == 1)
7 int ePin = 10; 42 { while(switchData == 1)
{ switchData =
8 43
digitalRead(switchPin);
9 int potPin = A4; 44 }
10 45 val = y - 1;
11 int switchPin = 11; 46 flag = 1;
12 93 break;
13 int flag = 0; 94 }
14 int tDelay = 0; 95 allLEDOff();
15 int val = 0; 96 }
16 int switchData = 0; 97
17 98 for(int z = ePin; z>=sPin && flag==0; z--)
18 void setup() 99 { digitalWrite(z,HIGH);
10
19 { pinMode(A, OUTPUT); delay(tDelay);
0
10
20 pinMode(B, OUTPUT);
1
10
21 pinMode(C, OUTPUT); switchData = digitalRead(switchPin);
2
10
22 pinMode(D, OUTPUT); if(switchData == 1)
3
10
23 { while(switchData == 1)
4
10 { switchData =
24 for(int x = sPin; x<=ePin; x++)
5 digitalRead(switchPin);
10
25 { pinMode(x,OUTPUT); }
6
10
26 } val = z - 1;
7
10
27 flag = 1;
8
10
28 Serial.begin(9600); break;
9
29 } 11 }
0
11
30 allLEDOff();
1
11
31 void loop() }
2
11
32 { tDelay = analogRead(potPin); }
3
11
33 switchData = digitalRead(switchPin);
4
11
34 if(switchData == 1) void allLEDOff()
5
11
35 { while(switchData == 1) { for(int a = sPin; a <=ePin; a++)
6
OPTIMIZED CODES
*code, process, memory, etc. optimization techniques are already applied in the source code.
Experiment 1
{ for(int y = sPin; y<=ePin && flag==0; y+
1 int A = A3; 36
+)
2 int B = A2; 37 { digitalWrite(y,HIGH);
3 int C = A1; 38 delay(tDelay);
4 int D = A0; 39
5 40 switchData = digitalRead(switchPin);
6 int sPin = 2; 41 if(switchData == 1)
7 int ePin = 10; 42 { while(switchData == 1)
{ switchData =
8 43
digitalRead(switchPin);
9 int potPin = A4; 44 }
10 45 val = y - 1;
11 int switchPin = 11; 46 flag = 1;
12 93 break;
13 int flag = 0; 94 }
14 int tDelay = 0; 95 allLEDOff();
15 int val = 0; 96 }
16 int switchData = 0; 97
17
18 void setup()
19 { pinMode(A, OUTPUT);
20 pinMode(B, OUTPUT);
21 pinMode(C, OUTPUT);
22 pinMode(D, OUTPUT);
23
24 for(int x = sPin; x<=ePin; x++)
Submitted to : ENGR. RAFAEL A. VENTURA
NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT
25 { pinMode(x,OUTPUT);
26 }
27
28 Serial.begin(9600);
29 }
30
31 void loop()
32 { tDelay = analogRead(potPin);
33 switchData = digitalRead(switchPin);
34 if(switchData == 1)
35 { while(switchData == 1)
SCENARIO nth
SCENARIO DESCRIPTION
Conditions :
the potentiometer controls the transition speed of the Running Light.
INITIAL CODES
*your group’s basic raw source code as long as it is working and complies with all the requirements.
*it is ok for the codes here if it is not yet optimized and full of user comments
Experiment 1
{ for(int y = sPin; y<=ePin && flag==0; y+
1 int A = A3; 36
+)
2 int B = A2; 37 { digitalWrite(y,HIGH);
3 int C = A1; 38 delay(tDelay);
4 int D = A0; 39
5 40 switchData = digitalRead(switchPin);
6 int sPin = 2; 41 if(switchData == 1)
7 int ePin = 10; 42 { while(switchData == 1)
{ switchData =
8 43
digitalRead(switchPin);
9 int potPin = A4; 44 }
10 45 val = y - 1;
11 int switchPin = 11; 46 flag = 1;
12 93 break;
13 int flag = 0; 94 }
14 int tDelay = 0; 95 allLEDOff();
15 int val = 0; 96 }
16 int switchData = 0; 97
17 98 for(int z = ePin; z>=sPin && flag==0; z--)
18 void setup() 99 { digitalWrite(z,HIGH);
10
19 { pinMode(A, OUTPUT); delay(tDelay);
0
10
20 pinMode(B, OUTPUT);
1
10
21 pinMode(C, OUTPUT); switchData = digitalRead(switchPin);
2
10
22 pinMode(D, OUTPUT); if(switchData == 1)
3
10
23 { while(switchData == 1)
4
10 { switchData =
24 for(int x = sPin; x<=ePin; x++)
5 digitalRead(switchPin);
10
25 { pinMode(x,OUTPUT); }
6
10
26 } val = z - 1;
7
10
27 flag = 1;
8
10
28 Serial.begin(9600); break;
9
11
29 } }
0
11
30 allLEDOff();
1
11
31 void loop() }
2
11
32 { tDelay = analogRead(potPin); }
3
11
33 switchData = digitalRead(switchPin);
4
11
34 if(switchData == 1) void allLEDOff()
5
11
35 { while(switchData == 1) { for(int a = sPin; a <=ePin; a++)
6
OPTIMIZED CODES
*code, process, memory, etc. optimization techniques are already applied in the source code.
Experiment 1
{ for(int y = sPin; y<=ePin && flag==0; y+
1 int A = A3; 36
+)
2 int B = A2; 37 { digitalWrite(y,HIGH);
3 int C = A1; 38 delay(tDelay);
4 int D = A0; 39
5 40 switchData = digitalRead(switchPin);
6 int sPin = 2; 41 if(switchData == 1)
7 int ePin = 10; 42 { while(switchData == 1)
{ switchData =
8 43
digitalRead(switchPin);
9 int potPin = A4; 44 }
10 45 val = y - 1;
11 int switchPin = 11; 46 flag = 1;
12 93 break;
13 int flag = 0; 94 }
14 int tDelay = 0; 95 allLEDOff();
15 int val = 0; 96 }
16 int switchData = 0; 97
Submitted to : ENGR. RAFAEL A. VENTURA
NATIONAL UNIVERSITY FAIRVIEW MICROPROCESSOR AND MICROCONTROLLER SYSTEMS AND DESIGN LABORATORY REPORT
17
18 void setup()
19 { pinMode(A, OUTPUT);
20 pinMode(B, OUTPUT);
21 pinMode(C, OUTPUT);
22 pinMode(D, OUTPUT);
23
24 for(int x = sPin; x<=ePin; x++)
25 { pinMode(x,OUTPUT);
26 }
27
28 Serial.begin(9600);
29 }
30
31 void loop()
32 { tDelay = analogRead(potPin);
33 switchData = digitalRead(switchPin);
34 if(switchData == 1)
35 { while(switchData == 1)
CONCLUSION
REFERENCES