 //FLAGS -- Mainloop
 int flag_check_ldr =  0;
 int flag_check_5v_brownout = 1;
-int flag_check_12v_brownout = 0;
+int flag_check_12v_brownout = 1;
 
 // FLAGS -- Status
 int flag_5v_brownout_detected = 0;

void check_for_5v_brownout(){
	// This function is used to check for stable 5 Volts
	input_5v = analogRead(pin_5v_brownout);
	if(flag_5v_brownout_detected == 1){
		// CHANGE LATER (to ensure actual brownout and not a minor fluctuation)
		if(input_5v<threshold_5v){
			turn_on_backup_battery();
			flag_5v_brownout_detected = 1;
		}
	}
	else{
		if(input_5v>threshold_5v){
			turn_off_backup_battery();
			flag_5v_brownout_detected = 0;
		}
	}	
}

void check_both_ldr(){

	pinMode(pin_ldr_1,INPUT);
	pinMode(pin_ldr_2,INPUT);
    pinMode(debug_pin,OUTPUT);
    pinMode(pin_relay_5v,OUTPUT);
    pinMode(pin_relay_12v,OUTPUT);
        
	// Safety Initializations
	turn_off_dynamixel();
