Final code for senior design project.  Completely reworked analog read functionality, added voltage and current controlled charging methods.  Plenty of redesigning left to do if it were to go into production-- will recommend a team next year look at making functions for currentControl(double current) and voltageControl(double voltage) to control state at a precise value.