zephyr/samples/drivers/button
Anas Nashif 4589f2c468 samples: use printf/printk directly instead of macros
In many cases there is no need to define a macro for printing to
the console, just use the correct variant directly.

Jira: ZEP-240
Change-Id: I9952deda4bfc60424f01fca2443d037562d13d0d
Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2016-09-14 16:56:02 +00:00
..
src samples: use printf/printk directly instead of macros 2016-09-14 16:56:02 +00:00
Makefile samples/button: button input example 2016-03-18 20:59:23 +00:00
README.txt samples/button: button input example 2016-03-18 20:59:23 +00:00
prj.conf Revert "misc: Remove generic PRINT macros from button samples" 2016-08-23 13:19:45 -07:00
prj.mdef samples/button: button input example 2016-03-18 20:59:23 +00:00

README.txt

Title: Button demo

Description:

A simple button demo showcasing the use of GPIO input with interrupts.

The demo assumes that a push button is connected to one of GPIO
lines. The sample code is configured to work on Nucleo-64 F103RB
board with button B1 providing the input.

After startup, the program looks up a predefined GPIO device (GPIOC),
and configures pin 13 in input mode, enabling interrupt generation on
falling edge. During each iteration of the main loop, the state of
GPIO line is monitored and printed to the serial console. When the
input button gets pressed, the interrupt handler will print an
information about this event along with its timestamp.

--------------------------------------------------------------------------------

Building and Running Project:

It can be built for a nucleo_f103rb board as follows:

    make

The code may need adaption before running the code on another board.

--------------------------------------------------------------------------------

Troubleshooting:

Problems caused by out-dated project information can be addressed by
issuing one of the following commands then rebuilding the project:

    make clean          # discard results of previous builds
                        # but keep existing configuration info
or
    make pristine       # discard results of previous builds
                        # and restore pre-defined configuration info

--------------------------------------------------------------------------------