need help with code

im new to coding and im making a school project for a phone controlled car and its not working any ideas

#define LOGGING



// Device drivers

// Enable one driver in each category



// Motor controller:

#define ENABLE_ADAFRUIT_MOTOR_DRIVER



// Distance sensor

#define ENABLE_NEWPING_DISTANCE_SENSOR_DRIVER



// Remote control:

//#define ENABLE_BLUESTICK_REMOTE_CONTROL_DRIVER

#define ENABLE_ROCKETBOT_REMOTE_CONTROL_DRIVER



#include <SoftwareSerial.h>

SoftwareSerial BTSerial(BT_RX_PIN, BT_TX_PIN);



#ifdef ENABLE_ADAFRUIT_MOTOR_DRIVER

#include <AFMotor.h>

#include "adafruit_motor_driver.h"

#define FRONT_LEFT_MOTOR_INIT 1

#define BACK_LEFT_MOTOR_INIT 2

#define FRONT_RIGHT_MOTOR_INIT 3

#define BACK_RIGHT_MOTOR _INIT 4

#endif



#ifdef ENABLE_BLUESTICK_REMOTE_CONTROL_DRIVER

#include "bluestick_remote_control.h"

#define REMOTE_CONTROL_INIT

#endif



#ifdef ENABLE_ROCKETBOT_REMOTE_CONTROL_DRIVER

#include "rocketbot_remote_control.h"

#define REMOTE_CONTROL_INIT 10,50

#endif



#include "logging.h"

#include "moving_average.h"



namespace envirobot

{
  
    class Robot
    
    {
      
    public:
    
        /*
          
         * @brief Class constructor.
         
         */
        Robot()
        
            : frontleftMotor(FRONT_LEFT_MOTOR_INIT), backleftMotor(BACK_LEFT_MOTROR_INIT), frontrightMotor(FRONT_RIGHT_MOTOR_INIT),backrightMotor(BACK_RGHT_MOTOR_INIT),
            
              distanceSensor(DISTANCE_SENSOR_INIT),
              
              distanceAverage(TOO_CLOSE * 10),
              
              remoteControl(REMOTE_CONTROL_INIT)
              
        {
          
            initialize();
            
        }

       
         
        void initialize()
        
        {
          
            randomSeed(analogRead(RANDOM_ANALOG_PIN));
            
            remote();
            
        }


         
        void run()
        
        {
            unsigned long currentTime = millis();
            
            int distance = distanceAverage.add(distanceSensor.getDistance());
            
            RemoteControlDriver::command_t remoteCmd;
            
            bool haveRemoteCmd = remoteControl.getRemoteCommand(remoteCmd);
            
            log("state: %d, currentTime: %lu, distance: %u remote: (%d,l:%d,r:%d,k:%d)\n", 
            
                state, currentTime, distance, 
                
                haveRemoteCmd, remoteCmd.left, remoteCmd.right, remoteCmd.key);

                
            
            if (remoteControlled()) {
              
                if (haveRemoteCmd) {
                  
                    switch (remoteCmd.key) {
                      
                    case RemoteControlDriver::command_t::keyF1:
                  
                    // switch back to remote mode
                    
                    remote();
                   
                }
                
                else {
                  
                    if (moving()) {
                      
                        if (obstacleAhead(distance))
                        
                            turn(currentTime);
                            
                    }
                    
                    else if (turning()) {
                      
                        if (doneTurning(currentTime, distance))
                        
                            move();
                            
                    }
                    
                }
                
            }
            
        }



    protected:
    
        void remote()
        
        {
          
            frontleftMotor.setSpeed(0);
            
            backleftMotor.setSpeed(0);
            
            frontrightMotor.setSpeed(0);
            
            backrightMotor.setSpeed(0);
            
            state = stateRemote;
            
        }
        

        
        void move()
        
        {
          
            frontleftMotor.setSpeed(255);
            
            backleftMotor.setSpeed(255);
            
            frontrightMotor.setSpeed(255);
            
            backrightMotor.setSpeed(255);
            
            state = stateMoving;
            
        }
        
        
        void stop()
        
        {
          
            frontleftMotor.setSpeed(0);
            
            backleftMotor.setSpeed(0);
            
            frontrightMotor.setSpeed(0);
            
            backrightMotor.setSpeed(0);
            
            state = stateStopped;
            
        }

        
        
        bool obstacleAhead(unsigned int distance)
        
        {
          
            return (distance <= TOO_CLOSE);
            
        }
        

        
        bool turn(unsigned long currentTime)
        
        {
          
            if (random(2) == 0) {
              
                frontleftMotor.setSpeed(-255);
                
                backleftMotor.setSpeed(-255);
                
                frontrightMotor.setSpeed(255);
                
                backrightMotor.setSpeed(255);
                
            }
            
            else {
              
                frontleftMotor.setSpeed(255);
                
                backleftMotor.setSpeed(255)
                
                frontrightMotor.setSpeed(-255);
                
                backrightMototr.setSpeed(255);
                
            }
            
            state = stateTurning;
            
            endStateTime = currentTime + random(500, 1000);
            
        }

        
        
        bool doneTurning(unsigned long currentTime, unsigned int distance)
        
        {
          
            if (currentTime >= endStateTime)
            
                return (distance > TOO_CLOSE);
                
            return false;
            
        }


        
        bool moving() { return (state == stateMoving); }
        
        bool turning() { return (state == stateTurning); }
        
        bool stopped() { return (state == stateStopped); }
        
        bool remoteControlled() { return (state == stateRemote); }
        

    private:
    
        Motor frontleftMotor; 
              
        Motor backleftMotor;
        
        Motor frontrightMotor;
        
        Motor backrightMotor;
       
        RemoteControl remoteControl;
        
        enum state_t { stateStopped, stateMoving, stateTurning, stateRemote };
        
        state_t state;
        
        unsigned long endStateTime;
        
    };
    
};



envirobot::Robot robot;



void setup()

{
  
    Serial.begin(9600);
    
    BTSerial.begin(9600);
    
}



void loop()

{
  
    robot.run();
    
}

Why is everything double-spaced?

Excess use of white space makes it hard to read.
Get rid of the extra lines. A single blank like before a function is OK.

And as Delta-G says, better describe your issue.
What did you expect it to do?
What does it actually do?
How do those two differ?