From 96bcb1c132aad9f1b79d34dd275f104991caf12d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Tue, 28 Feb 2023 14:08:25 +0100 Subject: [PATCH] reading current TODO refactor all code --- solar_panel.X/main.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/solar_panel.X/main.c b/solar_panel.X/main.c index ad5b932..26348da 100644 --- a/solar_panel.X/main.c +++ b/solar_panel.X/main.c @@ -73,18 +73,24 @@ void main(void) while (1) { - float value; + float valueV; - value =(float)( ADC_GetConversion(voltage)/19.859); + valueV =(float)( ADC_GetConversion(voltage)/19.859); // TODO explain values char msg[MAX_COL+1]; - snprintf(msg, MAX_COL+1, "Value : %3.1f mV ", value); + snprintf(msg, MAX_COL+1, "U = %3.1f [mV] ", valueV); //LCD_2x16_WriteCmd(0x01); // clear display LCD_2x16_WriteMsg(msg,0); + float valueI; + valueI =(float)( ADC_GetConversion(current)/57.667-220.9); // TODO explain values + + snprintf(msg, MAX_COL+1, "I = %3.1f [mA] ", valueI); + + LCD_2x16_WriteMsg(msg,1);