Files
solar_mppt_converter/mppt_app.c
Christian Lind Madsen 61d13470de first commit
2025-05-11 22:33:48 +02:00

25 lines
483 B
C

/*
* mppt_app.c
*
* Created: 11-05-2025 21:49:02
* Author: Christian L. V. Madsen (OZ1CM)
*/
#include "mppt_app.h"
// We are using resistor dividers that has a divide down factor of 8.
uint16_t voltLowToHigh(uint16_t low_voltage){
if(low_voltage > 2500) return 20000;
return low_voltage << 3;
}
// We are using differential amplifier with gain of 16.
uint16_t voltToCurrent(uint16_t low_voltage){
if(low_voltage > 2500) return 1000;
return low_voltage << 4;
}