|
| 1 | + |
| 2 | + |
| 3 | +--- |
| 4 | + |
| 5 | +# Pressure2 Click |
| 6 | + |
| 7 | +- **CIC Prefix** : PRESSURE2 |
| 8 | +- **Author** : MikroE Team |
| 9 | +- **Verison** : 1.0.0 |
| 10 | +- **Date** : avg 2018. |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | + |
| 15 | +### Software Support |
| 16 | + |
| 17 | +We provide a library for the Pressure2 Click on our [LibStock](https://libstock.mikroe.com/projects/view/1420/pressure-2-click) |
| 18 | +page, as well as a demo application (example), developed using MikroElektronika |
| 19 | +[compilers](http://shop.mikroe.com/compilers). The demo can run on all the main |
| 20 | +MikroElektronika [development boards](http://shop.mikroe.com/development-boards). |
| 21 | + |
| 22 | +**Library Description** |
| 23 | + |
| 24 | +The library initializes and defines the SPI bus driver and drivers that offer a choice for writing data in address and reads data from address. |
| 25 | +The library includes function for read Temperature data and Pressure data. |
| 26 | +The user also has the function for initializes and reset chip, sends ADC command, and function for read Coefficient. |
| 27 | + |
| 28 | +Key functions : |
| 29 | + |
| 30 | +- ``` uint8_t pressure2_init() ``` - Function for initialization chip |
| 31 | +- ``` void pressure2_readSensor( float *P, float *T ) ``` - Function for reads Pressure and Temperature data |
| 32 | + |
| 33 | +**Examples Description** |
| 34 | + |
| 35 | +The application is composed of three sections : |
| 36 | + |
| 37 | +- System Initialization - Initializes SPI module and sets CS pin as OUTPUT. |
| 38 | +- Application Initialization - Initializes driver init and chip init. |
| 39 | +- Application Task - (code snippet) - Reads sensor and logs to USBUART pressure and temperature every second. |
| 40 | + |
| 41 | +```.c |
| 42 | +void applicationTask() |
| 43 | +{ |
| 44 | + pressure2_readSensor( &pressure_P, &pressure_T ); |
| 45 | + |
| 46 | + mikrobus_logWrite( "Pressure: ", _LOG_TEXT ); |
| 47 | + FloatToStr( pressure_P, demoText ); |
| 48 | + demoText[6] = 0; |
| 49 | + mikrobus_logWrite( demoText, _LOG_LINE ); |
| 50 | + |
| 51 | + mikrobus_logWrite( "Temperature: ", _LOG_TEXT ); |
| 52 | + FloatToStr( pressure_T, demoText ); |
| 53 | + demoText[4] = 0; |
| 54 | + mikrobus_logWrite( demoText, _LOG_LINE ); |
| 55 | + mikrobus_logWrite( "-----------", _LOG_LINE ); |
| 56 | + Delay_ms( 1000 ); |
| 57 | +} |
| 58 | +``` |
| 59 | + |
| 60 | +The full application code, and ready to use projects can be found on our |
| 61 | +[LibStock](https://libstock.mikroe.com/projects/view/1420/pressure-2-click) page. |
| 62 | + |
| 63 | +Other mikroE Libraries used in the example: |
| 64 | + |
| 65 | +- SPI |
| 66 | + |
| 67 | +**Additional notes and informations** |
| 68 | + |
| 69 | +Depending on the development board you are using, you may need |
| 70 | +[USB UART click](http://shop.mikroe.com/usb-uart-click), |
| 71 | +[USB UART 2 Click](http://shop.mikroe.com/usb-uart-2-click) or |
| 72 | +[RS232 Click](http://shop.mikroe.com/rs232-click) to connect to your PC, for |
| 73 | +development systems with no UART to USB interface available on the board. The |
| 74 | +terminal available in all Mikroelektronika |
| 75 | +[compilers](http://shop.mikroe.com/compilers), or any other terminal application |
| 76 | +of your choice, can be used to read the message. |
| 77 | + |
| 78 | +--- |
| 79 | +--- |
0 commit comments