first commit
This commit is contained in:
25
mppt_app.c
Normal file
25
mppt_app.c
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user