Книга: Advanced PIC Microcontroller Projects in C

3.4 Summary

3.4 Summary

There are many assembly and high-level languages for the PIC18 series of microcontrollers. This book focuses on the mikroC compiler, since it is easy to learn and a free demo version is available that allows users to develop programs as large as 2K in size.

This chapter presented an introduction to the mikroC language. A C program may contain a number of functions and variables plus a main program. The beginning of the main program is indicated by the statement void main().

A variable stores a value used during the computation. All variables in C must be declared before they are used. A variable can be an 8-bit character, a 16-bit integer, a 32-bit long, or a floating point number. Constants are stored in the flash program memory of PIC microcontrollers, so using them avoids using valuable and limited RAM memory.

Various flow control and iteration statements such as if, switch, while, do, break, and so on have been described in the chapter, with examples.

Pointers are used to store the addresses of variables. As we shall see in the next chapter, pointers can be used to pass information back and forth between a function and its calling point. For example, pointers can be used to pass variables between a main program and a function.

Оглавление книги


Генерация: 0.032. Запросов К БД/Cache: 0 / 2
поделиться
Вверх Вниз