keylock 2.0.0.0
|
Keylock click carries a processed sealed key lock mechanism that can be set in three different positions. The click is designed to run on either 3.3V or 5V power supply.
We provide a library for the Keylock Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
This library contains API for Keylock Click driver.
- Initialization function.void keylock_cfg_setup ( keylock_cfg_t *cfg );
KEYLOCK_RETVAL keylock_init ( keylock_t *ctx, keylock_cfg_t *cfg );
- Gets key position.uint8_t keylock_check_pin ( keylock_t *ctx, uint8_t pin );
uint8_t keylock_get_position ( keylock_t *ctx );
This application monitors key position in its lock mechanism.
The demo application is composed of two sections :
Initialization driver enables GPIO and also writes log.
Detects the position in which the key currently is. Results are being sent to the Terminal, where you can track changes.
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.