We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2020-05-13
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Port expander
Downloaded: 2354 times
Not followed.
License: MIT license
Analog MUX click is a Click board that switches one of the sixteen inputs to one output. It employs the CD74HC4067, a High-Speed CMOS Logic 16-Channel Analog Multiplexer/Demultiplexer, produced by Texas Instruments.
Do you want to subscribe in order to receive notifications regarding "Analog Mux click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Analog Mux click" changes.
Do you want to report abuse regarding "Analog Mux click".
Library Description
This library allows user to perform a control of the Analog Mux Click board. Also user can check the indication status from the charger to get charging state. Fault condition also can be checked. For more details check documentation.
Key functions:
float analogmux_get_voltage ( float adc_value );
- Function used for get voltagevoid analogmux_set_channel ( uint8_t set_channel );
- Function used for set channelvoid analogmux_set_adc_vref ( uint16_t vref_mV );
- Function used for set vref in millivoltsExamples description
The application is composed of three sections :
void application_task ( )
{
uint8_t cnt = 0;
float voltage = 0;
float average_f = 0.0;
volatile uint32_t average_value = 0;
char demo_text[ 50 ];
for( cnt = 0; cnt < 10; cnt++ )
{
average_value += analogmux_adc_read( );
}
average_f = average_value / 10.0;
FloatToStr( average_f, demo_text );
mikrobus_logWrite( " ADC value: ", _LOG_TEXT );
mikrobus_logWrite( demo_text, _LOG_LINE );
voltage = analogmux_get_voltage( average_f );
FloatToStr( voltage, demo_text );
mikrobus_logWrite( " Voltage: ", _LOG_TEXT );
mikrobus_logWrite( demo_text, _LOG_LINE );
Delay_ms( 2000 );
mikrobus_logWrite( " <<< ------------------------ >>> ", _LOG_LINE );
}
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.