This is an old revision of the document!
In this scenario, you will implement a pattern using multiple LEDS. There are 4 LEDs connected to GPIOs 13, 12, 11, and 10 (D1 on top is GPIO 13; D4 at the bottom is GPIO 10). In this scenario, you will use blocking nested loops and manual calculation of the ticks needed to run them, to obtain precise delay, as presented in the chapter Introduction to the Arduino Uno programming in Assembler. You will use binary operations to control the GPIOs and to drive them in parallel.\\
Target group
This scenario is for beginners.
Prerequisites
You need to book one of the AVR laboratory nodes and ensure the video stream is live.
Scenario
[pczekalski][✓ pczekalski, 2026-05-03] Correct scenario AVR 1 to add Step 2 (or renumber it) and add scenario name here, or consider removing this section from scenarios.
[pczekalski] prepare template for scenario
[pczekalski] add image representing the flash pattern flow
Result
Observe flashing LEDs via the video stream.
Start
Mind to use AVR GCC syntax (as in the instruction): node compilation facilities are preconfigured, and you do not need to build a Makefile; still, it is necessary to follow the exact AVR GCC syntax, e.g., in the case of .equ.
Step 0
Compose an empty application with an infinite loop. Here we use some constants to use the .section directive is helpful.
Compile and check for any errors. Correct errors (if any), re-compile, and upload to the device. Naturally, nothing will happen now: your code is dummy, but you will ensure proper toolkit operation.
Step 1
Add to your code declarations regarding GPIO control ports for GPIO 13,12,1 and 10:
Step 3
Result validation
The LEDs should be flashing on an implemented time basis. Note that some irregularity may is observed due to the nature of video streaming over the network. It is natural and OK. If you want to measure more precise timing, increase the period, e.g. to 5s.
FAQ
When using the printed version of this manual, please refer to the latest online version of this document to obtain the most up-to-date list of FAQs.
It does not flash: Did you compile and upload to the device? Those are separate steps: it is not enough to just compile, but you also need to “flash” the MCU. Also, check your video stream if it “ticks” - the time embedded into the video stream should change. Your code may be working OK, but the video stream can be frozen, so you cannot see it working properly!