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
|
|
|
|
alias in their board device tree description file. Doing so will generate
|
|
|
|
these variables:
|
2017-01-07 07:49:24 +08:00
|
|
|
|
2018-12-21 18:08:06 +08:00
|
|
|
- LED0_GPIO_CONTROLLER
|
2017-01-07 07:49:24 +08:00
|
|
|
- LED0_GPIO_PIN
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
:board: arduino_101
|
|
|
|
: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.
|