Monday, 9 January 2012

InTra a.k.a Industrial Training

This year I have started my industrial training at UniKL BMI, Gombak which is where I studied. The main reason I came here is I have to carry a subject, Digital Design and easy for me to go to the class. Who knows I'll learn something new with my supervisor, Dr.Zulkhairi Yusof.
                                                               
                                                                        **********

2nd January 2012
Today, I should self-report to UniKL BMI but today is public holiday then tomorrow morning will be my first day.

                                                                       **********

3rd January 2012
Sharp at 8, I have arrived at BMI then I have reported myself at human resource department. After that, I go to the Technoputra Department which is my department. But, my supervisor, Dr. Zulkhairi is on leave. 
                                                                       
                                                                        ********** 

4th January 2012
Sharp at 3, I reported to my supervisor, Dr.Zulkhairi. After a little briefing from him, Dr. Zul wants me to do a project which is to design a tester for PIC 16F877A. The period time is about two weeks or one month. All the equipment that I needed will be given.
Also, he wants me build a blog easy to him to read my reports, give comments and etc.
So, I need to do the research about PIC16F877A. Actually programming is my big weaknesses but I will try my best to show the great result for Dr.Zul. InsyaAllah. :)
                                                    
                                                                         ********** 

5th January 2012
Today I just studied on C Programming. Actually Dr.Zul wants to teach me a little bit about C++ but then the installer with Aizuddin and he still on leave so, Dr.Zul gives me a simple notes for me to understand first then do the practical.

I have found that, C Programming has a simple concept which are :
i)   DIGS - Declare, Initialize, Get from user and Show.
ii)  CDR - Compute, Decide, and Repeat.
iii) FPASS - Function, Pointers, Array, String and Structure.


(D) - Declare
Knowing the type of data, and give a name to the storage bin is called declaration. Means that, you have to declare the keywords of the data. 
(I) - Initialize
Give an initial value to a variable. When you have declare the keywords of the data then you need to initialize the value or the details of the data.
(G) - Get from user
Sometimes we do not know the value.  We get the value from user. We use a library function called scanf.
scanf is not the keyword, therefore it must be declare somewhere. Therefore, either you declare the function or use a function already declared by somebody else(in the library). To use a library function, we type,
  #include<stdio.h>  where stdio.h is the library (h is the header files)
This statement is placed on top of the program (before any function).
(S) - Show
Show the content of the variables to user.
We use a library function called printf.
printf also not a keyword, so it must be declared. To use this library function, we type,
  #include<stdio.h> 
e.g to show the content of the variable year, we type:
  printf("%d",year);                                 -> 2009


The syntax is almost similar to scanf, except for the '&'.


To show any text on the screen, just type:
  printf("hello world");                            -> hello world


***Common programming mistake:
1.mis-spelled keyword    e.g. mian instead of main
2.forgot semicolon at the end of statement 
3.extra semicolon when not needed:   e.g.void main(void);
4)forgot '&' :   e.g. scanf("%d",year);
5)missing double quote:   e.g. printf("hello world);
6)misplaced the double quote: e.g. printf("radius = %d, radius");




***to be continued*** 

 

 








0 comments: