Start in a new project: copy your TemplateProject (Section D.5) and name the copy Lab1. We have put template.c on Canvas and in the book’s starter files (Appendix E): download it, place it in the project’s Src folder, and rename it to your first target filename. The template includes a header comment block. Fill in your name, assignment, a table of I/O pins and what they connect to, and a revision history for every file you submit.
Build and test incrementally: get one LED working before adding the second and third. Use descriptive #define names for every pin and timing constant, and keep track of your changes in comments.
Write blinkySIM.c: all three LEDs blink on and off simultaneously at the same rate. All three should turn on together, pause, turn off together, pause, and repeat.
Hint: if two LEDs are on the same GPIO port, you can set (or clear) both bits with a single OR (or AND) operation rather than two separate register writes.
Once blinkySIM.c is working, copy it to blinkySEQ.c. Modify the on/off logic so the three LEDs blink in sequence: only one lit at a time, cycling LED 1 → LED 2 → LED 3 → LED 1 → … continuously.
Write blinkyCNT.c: the three LEDs display a 3-bit binary count, cycling through 000, 001, 010, 011, 100, 101, 110, 111, 000, … with a short pause between each step. Designate which LED represents the least significant bit and which the most.
Hint: a loop variable incrementing from 0 to 7 can be used to drive the three LEDs. Use bit-twiddling expressions to extract each bit of the counter and map it to the appropriate GPIO pin.