Programming
Code examples for MIC24045 click, written for MikroElektronika hardware and compilers are
available on Libstock.
Codesnippet
The following code snippet calls initialization functions, and then slowly decrements the voltage
from maximum value down to the minimum.
01 void main()
02 {
03 system_init();
04 mic_24045_init(0x50);
05 Delay_ms (100);
06 i = 21;
07 while (i)
08 {
09 write_1 = i*0.25;
10 mic_24045_write_vout (write_1);
11 GPIOC_ODR = 0x04; /* Sets EN pin to 1 */
12 Delay_ms (1000);
13
14 read_2 = mic_24045_read_vout ();
15 FloatToStr (read_2, &uart_text);
16
17 if (read_2 > 1)
18 uart_text [5] = 0;
19
20 UART_Write_Text ("rn");
21 UART_Write_Text (uart_text);
22
23 GPIOC_ODR = 0x00;
24 Delay_ms (1000);
25 i--;
26 }
27 }
https://shop.mikroe.com/click/power‐management/mic240455‐1‐17