The latest development version of this page may be more current than this released 2.2.1 version.

Blinky sample


The Blinky example shows how to configure GPIO pins as outputs which can also be used to drive LEDs on the hardware usually delivered as “User LEDs” on many of the supported boards in Zephyr.


The demo assumes that an LED is connected to one of GPIO lines. The sample code is configured to work on boards that have defined the led0 alias in their board’s devicetree description file, <board>.dts. Doing so will generate these variables:



Building and Running

This sample does not output anything to the console. It can be built and flashed to a board as follows:

west build -b reel_board samples/basic/blinky
west flash

After flashing the image to the board, the user LED on the board should start to blink.