3.2 Your First mikroC Pro for PIC Program
Figure 3.1 shows a very simple mikroC Pro for PIC program. This program turns ON all the 8 LEDs connected to port B of a PIC microcontroller. Then, after a 500 millisecond delay, all the 8 LEDs are turned OFF. Do not worry if you do not understand the operation of this program at this stage, as all will be clear as we progress through this chapter. Some of the elements used in Figure 3.1 are described in detail here.
Figure 3.1 A very simple mikroC Pro for PIC program
3.2.1 Comments
Comments are used in programs to clarify the operation of the program. Although the use of comments are optional, it is strongly recommended that you use as many comments as possible in your programs, as comments make your programs readable and easily maintainable. Imagine how hard it would be to write a complex program with no comments and then try to modify the program after several months. All the comment lines are ignored by the compiler.
In mikroC Pro for PIC language, comments can be of two types: long comments and short comments. Long comments start with the character pair:
![]()
and end with the character pair:
![]()
Long comments are commonly used at the beginning ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access