Close

code changes

A project log for Web based solar panel monitoring/managment

Arduino enable web server to monitor a small solar array and power management systems.

garyGary 05/02/2014 at 00:480 Comments

I changed the straight line voltage  get code into a function so I can call it will multiple an analog pin number as a variable. Next is to do  turn the current gathering code into a function. This also offers flexibility to have some other chipset get the current and voltage and and all I need to do is fix the called code.

Calling code.

float voltage=get_voltage(A5); /get volatge on A5

Called code.

float get_voltage ( int vpin ) {

float gvolt=(analogRead(vpin)/4.092)/10;

return gvolt;  

Discussions