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: 2020-12-04
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Environmental
Downloaded: 1795 times
Not followed.
License: MIT license
pH Click is a compact add-on board that provides an opportunity for the user to read pH with the same accuracy and capabilities as with some other expensive solutions.
Do you want to subscribe in order to receive notifications regarding "pH click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "pH click" changes.
Do you want to report abuse regarding "pH click".
Library Description
The library covers all the functions necessary to control pH Click board™. It initializes and defines the UART drivers, and holds functions that allow full control of the device to the user.
Key functions:
void ph_send_cmd ( char *p_cmd );
- Function is used to send command and does not expect response.void ph_perf_calib ( char *point, float flt_val, char *p_resp );
- Function is used to perform calibration.ph_response ( char *p_resp );
- Function is used to handle collected data.Examples description
The application is composed of three sections :
void application_task ( )
{
char cmd;
ph_clr_log_buf( &log_txt[ 0 ] );
if ( UART_Rdy_Ptr() )
{
cmd = UART_Rd_Ptr( );
mikrobus_logWrite( "", _LOG_LINE );
mikrobus_logWrite( " pH value: ", _LOG_TEXT );
ph_send_cmd ( PH_CMD_SET_SNGL_READ );
Delay_ms( 1000 );
ph_response( &log_txt[ 0 ] );
mikrobus_logWrite( &log_txt[ 0 ], _LOG_LINE );
}
}
Additional Functions :
void float_to_str ( uint8_t byte_buf, uint8_t *str )
- Wrapper FloatToStr for driver function.void long_word_to_str ( uint32_t long_word_buf, uint8_t *str )
- Wrapper LongWordToStr for driver function.void byte_to_str ( uint8_t byte_buf, uint8_t *str )
- Wrapper ByteToStr for driver function.Other mikroE Libraries used in the example:
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.