This is a sample final report about automotive electrical and electronic engineering subject in HCMs university of technology and education. This is necessary for first and second student who do the final electronic reporttation.
MINISTRY OF EDUCATION AND TRAINING HCMC UNIVERSITY OF TECHNOLOGY AND EDUCATION FACULTY FOR HIGH QUALITY TRAINING - - Applied of Microcontroller Final report Leturer: Nguyen Trung Hieu Students: Bui My Ha (17145015) Nguyen Huynh Anh Tu (17145076) Hoang Ngoc Minh Quy (17145050) Ho Chi Minh, June 17th, 2019 1.Converting base: Binary ob00000001 ob00001010 ob00001111 ob00110011 ob11001100 ob11110000 ob11111010 ob11110101 ob11111110 ob1111111 Decimal 10 15 51 204 240 250 245 254 255 2.C programing: 2.1.Homework page #include int main() { /* my first program in C */ printf("Hello everyone! \n"); return 0; } 2.2.Homework page 20 Hex A F 33 CC F0 FA F5 FE FF #include //hw p20 /* global variable declaration*/ int g; int main () { /*global variable declaration*/ int a, b; /*actual initialization*/ a=5; b=10; g=a+b; printf ("value of a=%d, b=%d and g=%d\n",a,b,g); return 0; } 2.3.Homework page 23 #include main () { int a = 21; int b = 10; int c ; c = a + b; printf("Line - Value of c is %d\n", c ); c = a - b; printf("Line - valuae of c is %d\n", c ); c = a * b; printf("Line - valuae of c is %d\n", c); c = a / b; printf("Line - valuae of c is %d\n", c); c = a % b; printf("Line - value of c is %d\n", c); c = a++; printf("Line - value of c is %d\n", c); c = a ; printf("Line - value of c is %d\n", c); } 2.4Homework page 25 #include main() { int a=21; int b=10; int c; if ( a == b ) { printf ("line - a is equal to b\n"); } else { printf ("line - a is not equal to b\n"); } if ( a < b ) { printf("line 2- a is less than b\n"); } else { printf("line - a is not less than b\n"); } if ( a > b ) { printf("line - a is greater than b\n"); } else { printf("line - a is not greater than b\n"); } /* Lets change value of a and b*/ a=5; b=20; if ( a = a ) { printf("line - a is either greater or equal to b\n"); } } 2.5Homework page 27 #include main () { int a = 5; int b = 20; int c; if ( a && b ) { printf("line - condition is true\n"); } if ( a || b ) { printf("line - conditon is true\n"); } /*Lets change the value of a and b*/ a=0; b=10; if ( a && b ) { printf("line - condition is true\n"); } else { printf("line - condition is not true\n"); } if ( !(a && b) ) { printf ("line - condition is true\n"); } } 2.6Homework page 30 #include main () { unsigned int a = 60; /* 60 = 0011 1100 */ unsigned int b = 13; /* 13 = 0001 1101 */ int c = 0; c = a & b; /* 12= 0000 1100 */ printf ( "line - value of c is %d\n", c); c = a || b; /* 61= 0011 1101 */ printf ("line - value of c is %d\n", c); c = a ^ b; /* 49= 0011 0001*/ printf ("libe - value of c is %d\n",c); c =~ a; /* -61= 1100 0011*/ printf("line - value of c is %d\n",c); c = a > 2; /* 15= 0000 1111*/ printf ("line - value of c is %d\n",c); } 2.7.Homework page 33 #include main() { int a = 21; int c ; c = a; printf("Line - = Operator Example, Value of c = %d\n", c ) ; c += a; printf("Line - += Operator Example, Value of c =%d\n ", c ); c -= a; printf("Line - -= Operator Example, Value of c = %d\n ", c ); c *= a; printf("Line - *= Operator Example, Value of c = %d\n", c ); c /= a; printf("Line - /= Operator Example, Value of c = %d\n", c ); c = 200; c %= a; printf("Line - %= Operator Example, Value of c = %d\n", c ); c = 2; printf("Line ->>= Operator Example, Value of c = %d\n", c ); c &=2; printf("Line - &= Operator Example, Value of c = %d\n", c ); c ^= 2; printf("Line 10 - ^= Operator Example, Value of c = %d\n", c ); c |=2; { /* local variable definition */ char grade = 'B'; switch(grade) { case 'A' : printf("Excellent!\n" ); break; case 'B' : case 'C' : printf("Well done\n" ); break; case 'D' : printf("You pased\n" ); break; case 'F' : printf("Better try again\n" ); break; default : printf("Invalid grade\n" ); } printf("Your grade is %c\n", grade ); return 0; } 2.12.Homework page 49 #include int main () { /* global variable definition*/ int a=10; /* while loop excution*/ while (a=0;i ) { PORTD =LED7_Code[i]; delay_ms(100); } PORTC.3=0; delay_ms(50); PORTB.1=1; for (i=2;i>=0;i ) { PORTD =LED7_Code[i]; delay_ms(100); } PORTB.1=0; delay_ms(50); PORTB.0=1; for (i=9;i>=0;i ) { PORTD =LED7_Code[i]; delay_ms(100); } PORTB.0=0; delay_ms(50); } } 1.Moving led Segment LED LCD ... declaration*/ int a, b; /*actual initialization*/ a=5; b=10; g=a+b; printf ("value of a=%d, b=%d and g=%d\n",a,b,g); return 0; } 2.3.Homework page 23 #include main () { int a = 21; int... greater than b\n"); } else { printf("line - a is not greater than b\n"); } /* Lets change value of a and b*/ a=5; b=20; if ( a