Skip to content

MikroElektronika/Vacuum_click

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MikroE


Vacuum Click

  • CIC Prefix : VACUUM
  • Author : Katarina Perendic
  • Verison : 1.0.0
  • Date : sep 2018.

Software Support

We provide a library for the Vacuum Click on our LibStock page, as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Library Description

The library initializes and defines the I2C bus driver. The library includes function for reads ADC data and function for converting ADC value to percentage of Vacuum and pressure in mBar. The user also has the function for sensor calibration.

Key functions :

  • void vacuum_calibration() - Sensor calibration
  • uint16_t vacuum_readData() - Function for reads 12 bit ADC data
  • float vacuum_getVoltage() - Function for converting ADC value to pressure data
  • float vacuum_getPercentageOfVacuum() - Function for converting ADC value to percentage of Vacuum

Examples Description

The application is composed of three sections :

  • System Initialization - Initializes I2C module
  • Application Initialization - Initialization driver init and calibration of the chip to start measuring
  • Application Task - (code snippet) - Reads vacuum percentage that sensor reads
void applicationTask()
{
    mikrobus_logWrite("Vacuum (voltage) : ", _LOG_TEXT);
    Vacuum_volt = vacuum_getVoltage();
    FloatToStr(Vacuum_volt, demoText);
    mikrobus_logWrite(demoText, _LOG_TEXT);
    mikrobus_logWrite(" V", _LOG_LINE);
    
    mikrobus_logWrite("Percentage of vacuum: ", _LOG_TEXT);
    Vacuum = vacuum_getPercentageOfVacuum();
    FloatToStr(Vacuum, demoText);
    mikrobus_logWrite(demoText, _LOG_LINE);
    
    mikrobus_logWrite(" ", _LOG_LINE);
    Delay_ms(300);
}

The full application code, and ready to use projects can be found on our LibStock page.

Other mikroE Libraries used in the example:

  • I2C

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.