TOP Contributors

  1. MIKROE (2752 codes)
  2. Alcides Ramos (372 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139064 times)
  2. FAT32 Library (71594 times)
  3. Network Ethernet Library (56989 times)
  4. USB Device Library (47330 times)
  5. Network WiFi Library (43006 times)
  6. FT800 Library (42297 times)
  7. GSM click (29777 times)
  8. mikroSDK (27874 times)
  9. PID Library (26858 times)
  10. microSD click (26129 times)
Libstock prefers package manager

Package Manager

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]

< Back
Example

V to Hz 2 click

Rating:

5

Author: MIKROE

Last Updated: 2018-08-20

Package Version: 1.0.0.0

Example: 1.0.0.0

Category: Measurements

Downloaded: 3588 times

Not followed.

License: MIT license  

V to Hz 2 click is a device that converts an analog voltage input signal into a pulse wave signal of a certain frequency.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "V to Hz 2 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "V to Hz 2 click" changes.

Do you want to report abuse regarding "V to Hz 2 click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Example Blog

V to Hz 2 click

V to Hz 2 click

Native view of the V to Hz 2 click board.

View full image
V to Hz 2 click

V to Hz 2 click

Front and back view of the V to Hz 2 click board.

View full image

Library Description

Library initializes and defines GPIO driver and performs commands that can enable or disable the device and get frequency (FOUT) by getting the state of the INT pin. For more details check the documentation.

Key functions :

  • void vtohz2_enable( uint8_t state ) - The function performs enabling and disabling of the device.
  • uint8_t vtohz2_getFreqOut( void ) - The function gets the out frequency on mikrobus INT pin.

Example description

The application is composed of three sections:

  • System Initialization - Initializes peripherals and pins.
  • Application Initialization - Initializes GPIO driver, performs the device enable and sets the pwm frequency. Also writes help with the possible instructions.
  • Application Task - (code snippet) - Checks which command be entered on UART and sets the pwm duty cycle depending on the entered command.
void applicationTask()
{
 if (UART_Rdy_Ptr())
 {
 rxDat = UART_Rd_Ptr();

 if ((rxDat == '+') && (percCheck < 100))
 {
 pwmDutySum += onePercPwm;
 percCheck += 1;
 }
 else if ((rxDat == '-') && (percCheck > 0))
 {
 pwmDutySum -= onePercPwm;
 percCheck -= 1;
 }
 else if ((rxDat == '*') && (percCheck <= 90))
 {
 pwmDutySum += tenPercPwm;
 percCheck += 10;
 }
 else if ((rxDat == '/') && (percCheck >= 10))
 {
 pwmDutySum -= tenPercPwm;
 percCheck -= 10;
 }
 else if (rxDat == 'h')
 {
 vtohz2_writeHelp();
 }

 pwmDuty = pwmDutySum;
 vtohz2_setSpeed( pwmDuty );

 mikrobus_logWrite( "PWM Duty is : ", _LOG_TEXT );
 WordToStr( percCheck, text );
 mikrobus_logWrite( text, _LOG_TEXT );
 mikrobus_logWrite( " %", _LOG_LINE );
 }
}

Additional functions :

  • void vtohz2_writeHelp() - Writes instructions that perform the determined commands.
  • void vtohz2_setSpeed( uint16_t pwm_duty ) - Determines the desired pwm duty cycle and checks the limit of the pwm duty.
  • void vtohz2_pwmInit( uint32_t pwm_freq ) - Initializes the PWM with the desired frequency and calculates the maximal value of the pwm duty cycle.


Other mikroE Libraries used in the example:

  • Conversions
  • PWM
  • UART

Additional notes and information

Depending on the development board you are using, you may need USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

Button Y Click

0

Button Y Click is a Click board™ equipped with the tactile switch, sometimes referred to as a pushbutton. A pushbutton is a component that is used very often in various designs, allowing the user to interact with the application. Although it sounds simple, a button needs to comply with a range of application requirements. It needs to have a very good mechanical endurance while retaining its specifications, a predictable bouncing time, a very low ON resistance, very high OFF resistance, and it needs to fulfill aesthetical requirements.

[Learn More]

Color 18 Click

0

Color 18 Click is a compact add-on board for accurate ambient light detection and flicker monitoring. This board features the TCS3530, a true color ambient light sensor from ams OSRAM. The TCS3530 features true color XYZ sensing, flicker detection up to 7kHz, and eight concurrent sensing channels with independent gain configurations. It also includes a UV/IR blocking filter for precise light measurements and a unique Click Snap feature, allowing the main sensor area to become movable by breaking the PCB for flexible implementation.

[Learn More]

CO 2 Click

0

CO 2 Click is a very accurate, carbon-monoxide-gas-sensor Click board™, equipped with the SPEC amperometric, 3SP CO 1000 gas sensor which electrochemically reacts with the carbon monoxide (CO).

[Learn More]