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-10-03
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Adapter
Downloaded: 4472 times
Not followed.
License: MIT license
4D - display click is an adapter Click board that offers a mikroBUS interface for controlling 4D Systems gen4 Series intelligent Display Modules. 4D Systems designs and manufactures a wide range of Intelligent Display Modules equipped with powerful graphics processors.
Do you want to subscribe in order to receive notifications regarding "4D - display click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "4D - display click" changes.
Do you want to report abuse regarding "4D - display click".
Library Description
Library performs the control of the 4D Systems LCD displays via UART interface by sending the determined commands. The commands can read the objects and write the desired value to the objects, also they support sending the report from the device to the host. Before we start to use this library, first we must perform the LCD display programming. The UART baud rate on LCD and UART baud rate on the host device must be the same. The user can use our demo application for the 4D Systems LCD display, which simulates the speed measurement. For more details check the documentation.
Key functions
void c4d_writeObj( T_C4D_OBJ_P obj )
- Function writes the desired value to the desired object.void c4d_readObj( T_C4D_OBJ_P obj )
- Function reads the value of the desired object.uint8_t c4d_sendCommand( uint8_t _command, uint8_t *dataIn, uint8_t nBytes )
- Function sends command to the display.Example description
The application is composed of three sections:
void applicationTask()
{
c4d_readObj( (T_C4D_OBJ_P)&dipswitch0 );
if (dipswitch0.objValue != _C4D_INACTIVE_STATE)
{
if (enCheck == _C4D_INACTIVE_STATE)
{
led0.objValue = _C4D_ACTIVE_STATE;
c4d_writeObj( (T_C4D_OBJ_P)&led0 );
enCheck = _C4D_ACTIVE_STATE;
TIM2_CR1.CEN = _C4D_ACTIVE_STATE;
}
if (slider0.objValue != prevState)
{
leddigits0.objValue = slider0.objValue * 10;
coolgauge0.objValue = slider0.objValue;
if (slider0.objValue != _C4D_INACTIVE_STATE)
{
userled2.objValue = _C4D_ACTIVE_STATE;
}
else
{
userled2.objValue = _C4D_INACTIVE_STATE;
}
if (slider0.objValue >= 100)
{
userled1.objValue = _C4D_ACTIVE_STATE;
}
else
{
userled1.objValue = _C4D_INACTIVE_STATE;
}
if (slider0.objValue >= 200)
{
userled0.objValue = _C4D_ACTIVE_STATE;
}
else
{
userled0.objValue = _C4D_INACTIVE_STATE;
}
c4d_writeObj( (T_C4D_OBJ_P)&slider0 );
c4d_writeObj( (T_C4D_OBJ_P)&leddigits0 );
c4d_writeObj( (T_C4D_OBJ_P)&coolgauge0 );
c4d_writeObj( (T_C4D_OBJ_P)&userled0 );
c4d_writeObj( (T_C4D_OBJ_P)&userled1 );
c4d_writeObj( (T_C4D_OBJ_P)&userled2 );
prevState = slider0.objValue;
}
}
else if (enCheck == _C4D_ACTIVE_STATE)
{
TIM2_CR1.CEN = _C4D_INACTIVE_STATE;
slider0.objValue = _C4D_INACTIVE_STATE;
leddigits0.objValue = _C4D_INACTIVE_STATE;
coolgauge0.objValue = _C4D_INACTIVE_STATE;
userled0.objValue = _C4D_INACTIVE_STATE;
userled1.objValue = _C4D_INACTIVE_STATE;
userled2.objValue = _C4D_INACTIVE_STATE;
led0.objValue = _C4D_INACTIVE_STATE;
prevState = slider0.objValue;
enCheck = _C4D_INACTIVE_STATE;
transmission1 = _C4D_INACTIVE_STATE;
transmission2 = _C4D_INACTIVE_STATE;
transmission3 = _C4D_INACTIVE_STATE;
c4d_writeObj( (T_C4D_OBJ_P)&slider0 );
c4d_writeObj( (T_C4D_OBJ_P)&leddigits0 );
c4d_writeObj( (T_C4D_OBJ_P)&coolgauge0 );
c4d_writeObj( (T_C4D_OBJ_P)&userled0 );
c4d_writeObj( (T_C4D_OBJ_P)&userled1 );
c4d_writeObj( (T_C4D_OBJ_P)&userled2 );
c4d_writeObj( (T_C4D_OBJ_P)&led0 );
}
}
Additional Functions :
Other MikroElektronika libraries used in the example:
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.