The C programming language is an invaluable tool for programming microcontrollers using a high-level language. As introduced in SectionΒ 1.3, writing C programs for embedded systems is quite different from writing programs for general computing applications. This chapter is not intended to serve as an exhaustive reference for C; it will merely outline the most important concepts in programming C for microcontroller applications.
When writing out values in C, prefixes can be used to denote the number system of a value. If no prefix is used, the value is assumed to be in decimal (base 10). If the prefix 0b is used, the value is assumed to be in binary (base 2). If the prefix 0x is used, the value is assumed to be in hexadecimal (base 16).