Chapter 2. C Language Programming

In this chapter, we will cover the following topics:

  • Configuring the hardware abstraction layer
  • Writing a C program to blink each LED in turn
  • Writing a function
  • Writing to the console window
  • Writing to the GLCD
  • Creating a game application – Stage 1
  • Creating a game application – Stage 2
  • Debugging your code using print statements
  • Using the debugger

Introduction

This chapter will introduce you to writing programs in C, a high-level language developed in the 1970s and popular amongst embedded system developers. It is not the only high-level language that can be used to target embedded system applications, but it is the most widely used, because it produces executable code that is compact and very efficiently executed. Standards for C are published by the American National Standards Institute (ANSI) and the International Organization for Standardization (ISO). The current standard for the C Programming Language (C11) is ISO/IEC 9899:2011 (http://www.open-std.org/jtc1/sc22/wg14/www/standards).

Becoming a competent C programmer will take time, and although this chapter provides a starting point, you will undoubtedly need to consult other texts that provide a more thorough treatment of the topic. There are also a number of online resources such as http://crasseux.com/books/ctutorial/ and http://www.csd.uwo.ca/~jamie/C/index.html.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.227.9