 {
   read_data();                         //read data from inputs
   //MPPT_state_machine();                      //run the charger state machine
-  
+
+  // update power info
   static int current_power = 0;
   static unsigned int prev_seconds = 0;        // seconds value from previous pass
   if ((seconds - prev_seconds) > 4) {  
     prev_seconds = seconds;		// do this stuff once a second
 
-    if (current_power >= 250) {
+    if (current_power >= 400) {
       current_power = 100;
     }
     else {
-      current_power += 50;
+      current_power += 100;
     }
   }
 
   //constant_voltage_control(current_power);
-  constant_power_control(current_power);
-
+  //constant_voltage_control(500);
+  //constant_power_control(current_power);
+  constant_power_control(150);
+
+  // diagnosistic prints
   static int print_counter = 0;
   print_counter++;
-  if (print_counter > 10) {
-    print_data();                       //print data
-  }
-  
+  if (print_counter > 200) {
+    print_data(); 
+    print_counter = 0;
+  }
+
+
 //    read_data();                         //read data from inputs
 //    MPPT_state_machine();
 //    print_data();                       //print data

#define PWM_MAX             0.9*PWM_FULL  // the value for pwm duty cyle 0-100.0% (Resolution in 
#define PWM_MIN             0.1*PWM_FULL  // the value for pwm duty cyle 0-100.0%
#define PWM_START           0.1*PWM_FULL  // the value for pwm duty cyle 0-100.0%
#define PWM_INC             1             // the value the increment to the pwm value for the ppt algorithm

#define AVG_NUM             8             // number of iterations of the adc routine to average the adc readings
#define SOL_AMPS_SCALE      0.5           // the scaling value for raw adc reading to get solar amps scaled by 100 [(1/(0.005*(3.3k/25))*(5/1023)*100]

// battery volts. It is called with the adc channel number (pin number) and returns the average adc 
// value as an integer. 
//------------------------------------------------------------------------------------------------------
/*
int read_adc(int channel){
  
  int sum = 0;
