Lab 2 - BMT 1113
Lab 2 - BMT 1113
TECHNOLOGY
INTRODUCTION TO PROGRAMMING
(BMT 1113)
LAB 2
SEQUENCE PROGRAMMING
1.0 OBJECTIVES
2.0 THEORY
3.0 PROCEDURE
Sequence 1
Sequence 2
Sequence 3
Sequence 4
Sequence 5
Sequence 6
Sequence 7
Sequence 8
iii. Draw a flowchart to blink the LED in sequence according to the Table 1
provided.
iv. Open the Programming software. Write the program LED blinking below and
save the file.
sbit led1 at P1_0_bit;
sbit led2 at P1_1_bit;
sbit led3 at P1_2_bit;
sbit led4 at P1_3_bit;
sbit led5 at P1_4_bit;
void main()
{
{
Led1 = 1;
delay_ms(200);
led1 = 0;
delay_ms(200);
Led2 = 1;
delay_ms(200);
led2 = 0;
delay_ms(200);
Led3 = 1;
delay_ms(200);
led3 = 0;
delay_ms(200);
Led4 = 1;
delay_ms(200);
led4 = 0;
delay_ms(200);
Led5 = 1;
delay_ms(200);
led5 = 0;
delay_ms(200);
Led6 = 1;
delay_ms(200);
led6 = 0;
delay_ms(200);
Led7 = 1;
delay_ms(200);
led7 = 0;
delay_ms(200);
Led8 = 1;
delay_ms(200);
led8 = 0;
delay_ms(200);
}
}
void main()
{
While(1)
{
………………………………
iii. Run the program in the Proteus software. Differentiate the results in
Procedure 3.2 (ii) and Procedure 3.1 (iv). Evaluate your finding.
iv. After done testing the program, write down the complete program in
procedure 3.2(ii) and draw the flowchart in the space provided below (attach
another paper if the space provided is not enough).
Sequence 2
Sequence 3
Sequence 4
Sequence 2
Sequence 3
Sequence 4
Sequence 2
Sequence 2
iii. Next, open the Programming software. Produce a program code based on
flow chart at procedure 3.3(ii) and save the files in different name.
iv. Run the program in the Proteus software. Evaluate your finding.
v. After done testing the program, write down the program in the space provided
below (attach another paper if the space provided is not enough).
6.0 CONCLUSION
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________
_____________________________________________________________________