Giter VIP home page Giter VIP logo

color_6_click's Introduction

MikroE


Color6 Click

  • CIC Prefix : COLOR6
  • Author : Katarina Perendic
  • Verison : 1.0.0
  • Date : maj 2018.

Software Support

We provide a library for the Color6 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 and drivers that offer a choice for writing data in register. The library includes function for configuration chip for measurement, functions for read temperature, channel (X or Y or Z) data. The user also has the function float color6_convertingToEe(uint8_t channel, uint16_t MRES_data) which converts channel data to Ee (Input light irradiance regarding to the photodiode’s area within the conversion time interval) data.

Key functions :

  • uint16_t color6_readData(uint8_t reg) - Functions for read data from register
  • float color6_convertingToEe(uint8_t channel, uint16_t MRES_data) - Functions for converting channel data to Ee data
  • void color6_goToMeasurementMode() - Functions for go to measurement mode
  • float color6_getTemperature() - Functions for read temperature in C

Examples Description

The application is composed of three sections :

  • System Initialization - Initializes I2C module
  • Application Initialization - Initializes driver init and configuration chip for measurement
  • Application Task - (code snippet) - Reads values from the X / Y / Z channel and converts to Ee (input light irradiance regarding to the photodiode’s area within the conversion time interval) data. This data logs on USB UART every 2 seconds.
void applicationTask()
{
    mikrobus_logWrite(" Channel X :  ",_LOG_TEXT);
    X_data = color6_readData(_COLOR6_MREG_MEASUREMENT_X_CHANNEL );
    IntToStr(X_data, dataText);
    mikrobus_logWrite(dataText, _LOG_LINE);
    
    mikrobus_logWrite(" Ee X channel data:   ",_LOG_TEXT);
    Ee_data = color6_convertingToEe(_COLOR6_MREG_MEASUREMENT_X_CHANNEL, X_data);
    FloatToStr(Ee_data, dataText);
    mikrobus_logWrite(dataText, _LOG_LINE);
    
    mikrobus_logWrite(" Channel Y :  ",_LOG_TEXT);
    Y_data = color6_readData(_COLOR6_MREG_MEASUREMENT_Y_CHANNEL );
    IntToStr(Y_data, dataText);
    mikrobus_logWrite(dataText, _LOG_LINE);
    
    mikrobus_logWrite(" Ee Y channel data:   ",_LOG_TEXT);
    Ee_data = color6_convertingToEe(_COLOR6_MREG_MEASUREMENT_Y_CHANNEL, Y_data);
    FloatToStr(Ee_data, dataText);
    mikrobus_logWrite(dataText, _LOG_LINE);

    mikrobus_logWrite(" Channel Z :  ",_LOG_TEXT);
    Z_data = color6_readData(_COLOR6_MREG_MEASUREMENT_Z_CHANNEL );
    IntToStr(Z_data, dataText);
    mikrobus_logWrite(dataText, _LOG_LINE);
    
    mikrobus_logWrite(" Ee Z channel data:   ",_LOG_TEXT);
    Ee_data = color6_convertingToEe(_COLOR6_MREG_MEASUREMENT_Z_CHANNEL, Z_data);
    FloatToStr(Ee_data, dataText);
    mikrobus_logWrite(dataText, _LOG_LINE);

    mikrobus_logWrite(" Temperature :  ",_LOG_TEXT);
    temperature = color6_getTemperature();
    FloatToStr(temperature, dataText);
    mikrobus_logWrite(dataText, _LOG_LINE);
    
    mikrobus_logWrite(" ",_LOG_LINE);
    Delay_ms( 2000 );
}

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

Other mikroE Libraries used in the example:

  • Conversions
  • I2C
  • UART

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.



color_6_click's People

Contributors

kacaperendic avatar mvidoje avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

moxiaocong

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.