Lean Code for Small Machines
Marc Loy

#C_programming
#microcontrollers
#syntax
#Stack_Overflow
For makers looking to use the smallest microcontrollers or to wring the highest performance out of larger ones, the C language is still the best option. This practical book provides a solid grounding in C basics for anyone who tinkers with programming microcontrollers. You'll explore the many ways C enables developers and makers to get big results out of tiny devices.
Author Marc Loy shows you how to write clean, maintainable C code from scratch. This language and its cousin, C++, are still widely used to write low-level code for device drivers or operating systems. By understanding C syntax and its quirks, you'll gain an enduring computer language literacy that will help you pick up new languages and styles more easily.
No matter the reason, it’s great to have you here. All of those reasons are valid ones, by the way. C is a foundational language and understanding its syntax and quirks will give you a very long-lived computer language literacy that will help you pick up new languages and styles more easily. C (and C++) are still widely used when writing low-level code for device drivers or operating systems.
And the Internet of Things is breathing new life into microcontrollers with limited resources. C is a great fit for wringing the most of those tiny environments.
While I’ll be focusing on that last idea of writing clean, tight code for tiny, limited machines, I’ll still start with the basics of computer programming and cover a variety of rules & patterns that apply to C anywhere you might find it.
This book aims to cover all the basics of good C programming for any of the situations mentioned above. We’ll look at control structures, operators, functions, and other elements of C’s syntax along with examples of alternate patterns that can shave a few bytes off the size of your compiled program. We’ll also be looking at the Arduino environment as a great application for lean C code. To best enjoy the Arduino section, you should have some basic experience with building simple circuits and using components like LEDs and resistors.
The appendices include a handy collection of links to the hardware and software I use, as well as information on downloading and configuring the C and Arduino examples shown throughout the book.
Marc Loy caught the programming bug after learning 6808 assembly to program his school’s HERO 1 in the 80s. He developed and delivered training classes on Java, Unix internals, and networking at Sun Microsystems back in the day and has continued training a (much) wider audience ever since. He now spends his days consulting and writing on technical and media topics. He has also caught the maker bug and is exploring the fast-growing world of embedded electronics and wearables.









