Writing a C program to blink each LED in turn

This recipe extends the helloBlinky_c2v0 recipe introduced in the previous section, and includes a few more C programming statements. We'll call our new recipe helloBlinky_c2v1. uVision5's IDE features a so-called folding editor that allows blocks of code and comments to be hidden or expanded. This is quite useful for hiding complexity, allowing us to focus on the important details.

Getting ready…

First, we'll draw a flowchart describing what our program will do. Don't worry about the details at this stage, we just need to describe the behavior. A flowchart describing helloBlinky_c2v1 is shown as follows:

Our program will need to change the value of a number stored in memory that determines the LED that ...

Get ARM® Cortex® M4 Cookbook 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.