Ver código fonte

Also start with the charger state off

Ron Kuris 10 anos atrás
pai
commit
ffc61316a8
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      MPPT_Code/MPPT_Code.ino

+ 2 - 2
MPPT_Code/MPPT_Code.ino

@@ -173,17 +173,17 @@ 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
 {
+  pinMode(PWM_ENABLE_PIN, OUTPUT);     // sets the digital pin as output
   TURN_OFF_MOSFETS;                    // turn off MOSFET driver chip
+  charger_state = off;                 // start with charger state as off
   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
   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  
-  charger_state = on;                 // start with charger state as off
   pinMode(BACK_LIGHT_PIN, INPUT);      // backlight on button
   pinMode(LOAD_PIN,OUTPUT);            // output for the LOAD MOSFET (LOW = on, HIGH = off)
   digitalWrite(LOAD_PIN,HIGH);         // default load state is OFF