Basic Button Example
Demonstrates using the ZentriOS button library to handle GPIO input.
- SDK directory:
apps/basic/button
- Zentri App Store:
ZENTRI-BABUTTON
API Features Demonstrated
Platforms
This app works on:
- AMW004 - Zentri Mackerel evaluation board
- AMW106 - Zentri Moray evaluation board. See Using AMW106 Button 1 with the ZentriOS SDK.
Requirements and Prerequisites
Requires a ZentriOS evaluation board.
Description
When a button on the evaluation board is pressed or released, the app writes a message to the ZentriOS log bus indicating which button was touched and what action took place.
Implementation
During app initialization, the app sets up button configuration which includes handlers for button events.
The calls to button_init apply the configuration to each button.
Each handler sends a message appropriate to the action that invoked the handler.
Source Code
See: