2017-04-05 03:20:40 +08:00
|
|
|
.. _blinky-sample:
|
|
|
|
|
2016-10-02 11:28:54 +08:00
|
|
|
Blinky Application
|
|
|
|
##################
|
|
|
|
|
|
|
|
Overview
|
2017-01-21 07:58:05 +08:00
|
|
|
********
|
2016-10-02 11:28:54 +08:00
|
|
|
|
|
|
|
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.
|
2017-01-07 07:49:24 +08:00
|
|
|
|
|
|
|
Requirements
|
2017-01-21 07:58:05 +08:00
|
|
|
************
|
2017-01-07 07:49:24 +08:00
|
|
|
|
|
|
|
The demo assumes that an LED is connected to one of GPIO lines. The
|
2018-12-21 18:08:06 +08:00
|
|
|
sample code is configured to work on boards that have defined the led0
|
2019-10-08 01:37:09 +08:00
|
|
|
alias in their board devicetree description file. Doing so will generate
|
2018-12-21 18:08:06 +08:00
|
|
|
these variables:
|
2017-01-07 07:49:24 +08:00
|
|
|
|
2019-06-22 23:59:19 +08:00
|
|
|
- DT_ALIAS_LED0_GPIOS_CONTROLLER
|
|
|
|
- DT_ALIAS_LED0_GPIOS_PIN
|
2017-01-07 07:49:24 +08:00
|
|
|
|
|
|
|
|
|
|
|
Building and Running
|
2017-01-21 07:58:05 +08:00
|
|
|
********************
|
2017-01-07 07:49:24 +08:00
|
|
|
|
|
|
|
This samples does not output anything to the console. It can be built and
|
|
|
|
flashed to a board as follows:
|
|
|
|
|
2017-11-12 17:12:44 +08:00
|
|
|
.. zephyr-app-commands::
|
|
|
|
:zephyr-app: samples/basic/blinky
|
2019-06-13 20:31:56 +08:00
|
|
|
:board: reel_board
|
2017-11-12 17:12:44 +08:00
|
|
|
:goals: build flash
|
|
|
|
:compact:
|
2017-01-07 07:49:24 +08:00
|
|
|
|
|
|
|
After flashing the image to the board, the user LED on the board should start to
|
|
|
|
blink.
|