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: 2019-03-07
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Capacitive
Downloaded: 3259 times
Not followed.
License: MIT license
ProxFusion 2 Click is an ambient lighting, capacitive, Hall-effect, and inductive sensing Click board which features a single multifunctional sensor IC.
Do you want to subscribe in order to receive notifications regarding "ProxFusion 2 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "ProxFusion 2 click" changes.
Do you want to report abuse regarding "ProxFusion 2 click".
Library Description
The library initializes and defines the I2C bus or SPI bus driver and drivers that offer a choice for writing data in register. The library includes function for read ambient light, hall-effect and temperature and function for detect touch. The user also has the function for initializes chip and configuration chip.
Key functions:
void proxfusion2_configuration()
- Function for configuration chipuint8_t proxfusion2_init()
- Function for initializes chipuint8_t proxfusion2_detectTouch()
- Function for detect Touchuint8_t proxfusion2_detectDark_Light(uint8_t *ALS_range)
- Function for read ambient lightuint8_t proxfusion2_detectHall()
- Function for read Hall-effectExamples description
The application is composed of the three sections :
void applicationTask()
{
mikrobus_logWrite("_________________________________________________________________________", _LOG_LINE);
mikrobus_logWrite("| TOUCH | T - UI | AMBIENT | ALS RANGE | ALS UI | HALL | HALL UI |",_LOG_LINE);
// TOUCH
Touch = proxfusion2_readByte(0x13);
if ((Touch & 0x02) != 0)
{
mikrobus_logWrite("| YES |", _LOG_TEXT);
}
else
{
mikrobus_logWrite("| NO |", _LOG_TEXT);
}
dataRead = proxfusion2_readData( _PROXFUSION2_HYSTERESIS_UI_OUTPUT );
IntToStr(dataRead, demoText);
mikrobus_logWrite(demoText, _LOG_TEXT);
mikrobus_logWrite(" |",_LOG_TEXT);
// AMBIENT
darkLight_ambient = proxfusion2_detectDark_Light(&ALS_range);
if (darkLight_ambient == _PROXFUSION2_DARK_AMBIENT )
{
mikrobus_logWrite(" DARK |",_LOG_TEXT);
}
else
{
mikrobus_logWrite(" LIGHT |",_LOG_TEXT);
}
IntToStr(ALS_range, demoText);
mikrobus_logWrite(demoText, _LOG_TEXT);
mikrobus_logWrite(" |",_LOG_TEXT);
dataRead = proxfusion2_readData( _PROXFUSION2_ALS_UI_OUTPUT );
IntToStr(dataRead, demoText);
mikrobus_logWrite(demoText, _LOG_TEXT);
mikrobus_logWrite(" |",_LOG_TEXT);
// HALL
hall_detect = proxfusion2_detectHall();
if (hall_detect != 0)
{
if( hall_detect == 1 )
{
mikrobus_logWrite(" NORTH |",_LOG_TEXT);
}
else
{
mikrobus_logWrite(" SOUTH |",_LOG_TEXT);
}
}
dataRead = proxfusion2_readData( _PROXFUSION2_HALL_EFFECT_UI_OUTPUT );
IntToStr(dataRead, demoText);
mikrobus_logWrite(demoText, _LOG_TEXT);
mikrobus_logWrite(" |",_LOG_LINE);
Delay_ms(3000);
}
Other mikroE Libraries used in the example:
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.