Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 //2ak1009_Solar_VI 00002 // for Solar charger Copyright by K.Takeuchi 00003 00004 #include "mbed.h" 00005 #include "TextLCD2004.h" 00006 00007 #define ON 1 00008 #define OFF 0 00009 00010 AnalogIn Vbat_adc(p20); 00011 AnalogIn Vsolar_adc(p19); 00012 AnalogIn Isolar_adc(p18); 00013 00014 TextLCD lcd(p24, p25, p26, p27, p28, p29, p30,20,4); // rs, rw, e, d0, d1, d2, d3 00015 LocalFileSystem local("local"); 00016 00017 int main() { 00018 float Vbat,Vsolar,Isolar; 00019 lcd.cls(); 00020 lcd.locate(0,0); 00021 lcd.printf("=Solar MPPT Sys.="); 00022 lcd.locate(0,1); 00023 lcd.printf("System start!!"); 00024 wait(2.0); 00025 00026 while(1){ 00027 Vbat=Vbat_adc.read()*30; 00028 Vsolar=Vsolar_adc.read()*30; 00029 Isolar=(Isolar_adc.read()*3.3-2.5)/185*1000; 00030 lcd.cls(); 00031 lcd.locate(0,0); 00032 lcd.printf("=Solar MPPT Sys.="); 00033 lcd.locate(0,1); 00034 lcd.printf("Sp V:%2.1fV,I:%1.2fA",Vsolar,Isolar); 00035 lcd.locate(0,2); 00036 lcd.printf("Vbat:%2.1fV",Vbat); 00037 lcd.locate(0,3); 00038 lcd.printf("W:%2.2fW",Vsolar*Isolar); 00039 wait(0.5); 00040 lcd.locate(0,0); 00041 lcd.printf("=Solar MPPT Sys ="); 00042 wait(0.5); 00043 }//while 00044 }//main 00045 00046
Generated on Thu Jul 14 2022 16:24:39 by
