Chapter twelve

C language

Objectives

The objectives of this chapter are that, after studying it, the reader should be able to:

  • Comprehend the main features of C programs.
  • Use C to write simple programs for microcontrollers.

12.1 Why C?

This chapter is intended to give an introduction to the C language and the writing of programs. C is a high-level language that is often used in place of assembly language (see Chapter 11) for the programming of microprocessors. It has the advantages when compared with the assembly language of being easier to use and that the same program can be used with different microprocessors; all that is necessary for this is that the appropriate compiler is used to translate the C program into the relevant machine ...

Get Mechatronics: Electronic Control Systems In Mechanical and Electrical Engineering, 7th Edition by Pearson now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.