opto 2.0.0.0
|
OPTO Click is an accessory board in mikroBUS form factor. It features two VO2630 dual channel, high speed optocoupler modules.
We provide a library for the OPTO 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 OPTO Click driver.
- Initialization function.void opto_cfg_setup ( opto_cfg_t *cfg );
OPTO_RETVAL opto_init ( opto_t *ctx, opto_cfg_t *cfg );
void opto_default_cfg ( opto_t *ctx );
- Function checks the state of OUT2 pin.uint8_t opto_check_out1( opto_t *ctx );
uint8_t opto_check_out2( opto_t *ctx );
uint8_t opto_check_out3( opto_t *ctx );
uint8_t opto_check_out4( opto_t *ctx );
This example checks the state of selected inputs and prints it.
The demo application is composed of two sections :
Initialization driver enables GPIO and also starts write log.
This example demonstrates the use of OPTO Click board by performing the check procedure for selected outputs and displays the results on USART terminal.
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.