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: 2018-08-15
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Measurements
Downloaded: 4554 times
Not followed.
License: MIT license
HZ to V 2 click is a device that can convert input frequency of the signal with virtually any wave shape to a DC voltage output, with a level proportional to the input frequency.
Do you want to subscribe in order to receive notifications regarding "Hz to V 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Hz to V 2 click" changes.
Do you want to report abuse regarding "Hz to V 2 click".
Library Description
Library provides generic functions for working with the click board.
Key functions :
void hztov2_enPin(uint8_t pinState)
- Function for enabling the click board.void hztov2_adcInit()
- Prepare the ADC for voltage readings.float hztov2_adcRead()
- Read the voltages and return the return the float voltage value.Example description
The application is composed of three sections:
void applicationTask()
{
float voltage;
char txt[20];
voltage = hztov2_adcRead();
if(voltage<0.99)
{
voltage = voltage * 1000.0;
FloatToStr(voltage,txt);
txt[5] = 'm';
txt[6] = 'V';
txt[7] = 0;
}
else
{
FloatToStr(voltage,txt);
txt[5] = ' ';
txt[6] = 'V';
txt[7] = 0;
}
mikrobus_logWrite(txt,_LOG_LINE);
Delay_ms(100);
}
Other mikroE Libraries used in the example:
Additional notes and information
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.