Skip to content

Commit

Permalink
Also move it up, do this as early as possible
Browse files Browse the repository at this point in the history
  • Loading branch information
rkuris committed Jul 2, 2015
1 parent a55579f commit 05c5c6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MPPT_Code/MPPT_Code.ino
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // Set the LCD I

void setup() // run once, when the sketch starts
{
TURN_OFF_MOSFETS; // turn off MOSFET driver chip
pinMode(LED_RED, OUTPUT); // sets the digital pin as output
pinMode(LED_GREEN, OUTPUT); // sets the digital pin as output
pinMode(LED_YELLOW, OUTPUT); // sets the digital pin as output
pinMode(PWM_ENABLE_PIN, OUTPUT); // sets the digital pin as output
Timer1.initialize(20); // initialize timer1, and set a 20uS period
Timer1.pwm(PWM_PIN, 0); // setup pwm on pin 9, 0% duty cycle
TURN_ON_MOSFETS; // turn off MOSFET driver chip
Timer1.attachInterrupt(callback); // attaches callback() as a timer overflow interrupt
Serial.begin(9600); // open the serial port at 38400 bps:
pwm = PWM_START; // starting value for pwm
Expand Down

4 comments on commit 05c5c6c

@deba168
Copy link
Owner

@deba168 deba168 commented on 05c5c6c Jul 2, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we made the driver off.There is no current flow from
Solar panel to battery. So power is also zero.As per logic the charger never start.

@rkuris
Copy link
Contributor Author

@rkuris rkuris commented on 05c5c6c Jul 2, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, we need to turn it on later inside the loop when we know we have everything else set up correctly. Let me fix that as well.

@deba168
Copy link
Owner

@deba168 deba168 commented on 05c5c6c Jul 3, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In code you have move the line code for driver up.But I can not find the piece of code where the charger starts.

@rkuris
Copy link
Contributor Author

@rkuris rkuris commented on 05c5c6c Jul 3, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, there is one more change required. I haven't been able to test this yet.

Please sign in to comment.