fan2 2.0.0.0
|
Fan 2 click carries the MAX31760 precision fan-speed controller. It can measure temperature and adjust the fan speed to keep the temperature at the same level. Fan 2 click can also control two fans at the same time.
We provide a library for the Fan2 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.
This library contains API for Fan2 Click driver.
- Click Initialization function.
fan2_err_t fan2_init( fan2_t *ctx, fan2_cfg_t *cfg );
void fan2_default_cfg( fan2_t *ctx, fan2_wire_t n_wires );
- Tachometer Read function.fan2_err_t fan2_generic_write_byte( fan2_t *ctx, uint8_t reg_addr, uint8_t data_in );
fan2_err_t fan2_read_tacho( fan2_t *ctx, uint8_t tacho_addr, uint32_t *tacho_rpm );
fan2_err_t fan2_direct_speed_control( fan2_t *ctx, float speed_per );
This example demonstrates the use of Fan 2 Click board. It demonstrates sensor measurements and fan control.
The demo application is composed of two sections :
Initializes I2C driver and executes a default configuration for Fan 2 click. Also initializes UART logger for results logging.
Increments the fan speed from half speed to maximum, and on each step measures the current fan speed in RPM and the remote temperature in Celsius. Fan speed will be incremented/decremented each second for 10 percents.
The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.
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.