I am having errors with this code could someone help.

#include <Arduino.h>
#include "CurieIMU.h"
#include "DHT.h"
#include "NewPing.h"



// Pin Definitions
#define DHT_PIN_DATA  2
#define HCSR04_PIN_TRIG 4
#define HCSR04_PIN_ECHO 3
#define IROBJAVOID_1_PIN_OUT  5
#define IROBJAVOID_2_PIN_OUT  6
#define IROBJAVOID_3_PIN_OUT  7
#define IROBJAVOID_4_PIN_OUT  8



// Global variables and defines

// object initialization

DHT dht(DHT_PIN_DATA);
NewPing hcsr04(HCSR04_PIN_TRIG, HCSR04_PIN_ECHO);



// define vars for testing menu
const int timeout = 10000;       //define timeout of 10 sec
char menuOption = 0;
long time0;

// Setup the essentials for your circuit to work. It runs first every time your circuit is powered with electricity.


void setup() {
  Serial.begin(921600); // initialize Serial communication
  while (!Serial); // wait for serial port to connect. Needed for native USB
  Serial.println("start");

  dht.begin();
  CurieIMU.begin();

  // Set the accelerometer range to 2G
  CurieIMU.setAccelerometerRange(2);
  Serial.println("Initializing IMU device...");
  pinMode(IROBJAVOID_1_PIN_OUT, INPUT);
  pinMode(IROBJAVOID_2_PIN_OUT, INPUT);
  pinMode(IROBJAVOID_3_PIN_OUT, INPUT);
  pinMode(IROBJAVOID_4_PIN_OUT, INPUT);
  menuOption = menu();    // wait for the serial port to open

  // initialize device


}

void loop() {
  if (menuOption == '1') {
    // DHT22/11 Humidity and Temperature Sensor - Test Code
    // Reading humidity in %
    float dhtHumidity = dht.readHumidity();
    // Read temperature in Celsius, for Fahrenheit use .readTempF()
    float dhtTempC = dht.readTempC();
    Serial.print(F("Humidity: ")); Serial.print(dhtHumidity); Serial.print(F(" [%]\t"));
    Serial.print(F("Temp: ")); Serial.print(dhtTempC); Serial.println(F(" [C]"));

  }
  else if (menuOption == '2') {
    // Ultrasonic Sensor - HC-SR04 - Test Code
    // Read distance measurment from UltraSonic sensor
    int hcsr04Dist = hcsr04.ping_cm();
    delay(10);
    Serial.print(F("Distance: ")); Serial.print(hcsr04Dist); Serial.println(F("[cm]"));

  }
  else if (menuOption == '3') {
    // IR Obstacle Avoidance Sensor #1 - Test Code
    //Read IR obstacle Sensor. irObjAvoid_1Var will be '1' if an Obstacle was detected
    //Use the onboard trimmer to set the distance of alert
    bool irObjAvoid_1Var = !digitalRead(IROBJAVOID_1_PIN_OUT);
    Serial.print(F("ObjAvoid: ")); Serial.println(irObjAvoid_1Var);

  }
  else if (menuOption == '4') {
    // IR Obstacle Avoidance Sensor #2 - Test Code
    //Read IR obstacle Sensor. irObjAvoid_2Var will be '1' if an Obstacle was detected
    //Use the onboard trimmer to set the distance of alert
    bool irObjAvoid_2Var = !digitalRead(IROBJAVOID_2_PIN_OUT);
    Serial.print(F("ObjAvoid: ")); Serial.println(irObjAvoid_2Var);

  }
  else if (menuOption == '5') {
    // IR Obstacle Avoidance Sensor #3 - Test Code
    //Read IR obstacle Sensor. irObjAvoid_3Var will be '1' if an Obstacle was detected
    //Use the onboard trimmer to set the distance of alert
    bool irObjAvoid_3Var = !digitalRead(IROBJAVOID_3_PIN_OUT);
    Serial.print(F("ObjAvoid: ")); Serial.println(irObjAvoid_3Var);

  }
  else if (menuOption == '6') {
    // IR Obstacle Avoidance Sensor #4 - Test Code
    //Read IR obstacle Sensor. irObjAvoid_4Var will be '1' if an Obstacle was detected
    //Use the onboard trimmer to set the distance of alert
    bool irObjAvoid_4Var = !digitalRead(IROBJAVOID_4_PIN_OUT);
    Serial.print(F("ObjAvoid: ")); Serial.println(irObjAvoid_4Var);

  }
  else if (menuOption == '7') {
    float ax, ay, az;   //scaled accelerometer values
    CurieIMU.readAccelerometerScaled(ax, ay, az);
  }




  if (millis() - time0 > timeout)
  {
    menuOption = menu();
  }

  char menu()
  {

    Serial.println(F("\nWhich component would you like to test?"));
    Serial.println(F("(1) DHT22/11 Humidity and Temperature Sensor"));
    Serial.println(F("(2) Ultrasonic Sensor - HC-SR04"));
    Serial.println(F("(3) IR Obstacle Avoidance Sensor #1"));
    Serial.println(F("(4) IR Obstacle Avoidance Sensor #2"));
    Serial.println(F("(5) IR Obstacle Avoidance Sensor #3"));
    Serial.println(F("(6) IR Obstacle Avoidance Sensor #4"));
    Serial.println(F("(7) Accelerometer onboard sensor"));
    Serial.println(F("(menu) send anything else or press on board reset button\n"));
    while (!Serial.available());

    // Read data from serial monitor if received
    while (Serial.available())
    {
      char c = Serial.read();
      if (isAlphaNumeric(c))
      {
        if (c == '1')
          Serial.println(F("Now Testing DHT22/11 Humidity and Temperature Sensor"));
        else if (c == '2')
          Serial.println(F("Now Testing Ultrasonic Sensor - HC-SR04"));
        else if (c == '3')
          Serial.println(F("Now Testing IR Obstacle Avoidance Sensor #1"));
        else if (c == '4')
          Serial.println(F("Now Testing IR Obstacle Avoidance Sensor #2"));
        else if (c == '5')
          Serial.println(F("Now Testing IR Obstacle Avoidance Sensor #3"));
        else if (c == '6')
          Serial.println(F("Now Testing IR Obstacle Avoidance Sensor #4")); \
        else if (c == '7') {
          Serial.print("a:\t");
          Serial.print(ax);
          Serial.print("\t");
          Serial.print(ay);
          Serial.print("\t");
          Serial.print(az);
          Serial.println();
        }
        else
        {
          Serial.println(F("illegal input!"));
          return 0;
        }
        time0 = millis();
        return c;
      }
    }
  }

And the output was==

src\main.cpp:158:25: error: ‘menu’ was not declared in this scope

menuOption = menu();
^
src\main.cpp:162:3: error: a function-definition is not allowed here before ‘{’ token
{
^
src\main.cpp:211:3: error: expected ‘}’ at end of input
}
^
*** [.pioenvs\genuino101\lib4fb\DHT sensor library_ID19\DHT_U.cpp.o] Error 1
*** [.pioenvs\genuino101\src\main.cpp.o] Error 1
[ERROR] Took 1.83 seconds
Unable to execute: platformio
Make sure cmd:‘platformio’ and cwd:‘C:\Users\Talha Patelia\Documents\PlatformIO\Projects\robot’ exists and h
ave correct access permissions.
Binaries are found in these folders: C:\Program Files\Haskell\bin;D:\Apps\haskell\8.4.3\lib\extralibs\bin;D:
\Apps\haskell\8.4.3\bin;C:\Program Files\Microsoft MPI\Bin;C:\Program Files (x86)\Intel\Intel(R) Management
Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS;C:\Windows\syste
m32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\I
ntel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components
DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) M
anagement Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotn
et;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32
\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files\PuTTY;D:\Ap
ps\command;D:\Apps\haskell\8.4.3\mingw\bin;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;D:\Apps\LLVM\b
in;D:\Apps\bin;C:\Users\Talha Patelia\AppData\Roaming\cabal\bin;C:\Users\Talha Patelia\AppData\Local\Microso
ft\WindowsApps;C:\Users\Talha Patelia\AppData\Local\atom\bin;C:\Users\Talha Patelia\AppData\Local\GitHubDesk
top\bin

Linter
Severity Provider Description Line
Error GCC DHT.h: No such file or directory 42:19
Error Build error: no matching function for call to 'DHT::DHT(int)'e 62:23
Error Build error: ‘menu’ was not declared in this scopee 90:21
Error Build error: ‘class DHT’ has no member named 'readTempC’e 103:24
Error Build error: ‘menu’ was not declared in this scopee 158:25
Error Build error: a function-definition is not allowed here before ‘{’ tokene 162:3
Error Build error: expected ‘}’ at end of inpute 211:3
PIO Buildsrc\main.cpp7001:1(211, 6468)
CRLFUTF-8C++GitHubGit (0)

Your loop function is missing a closing brace.

Also, you need to tell the DHT library which device (DHT22 or DHT11) you’re using.

You can't define a function inside a function. The missing close bracket in loop() means that the compiler sees your declaration of menu() as being inside loop(). The declaration of menu() is thrown out as invalid so menu() "is not declared in this scope".

#include <Arduino.h>



  #include "CurieIMU.h"
  #include "DHT.h"
  #include "DHT_U.h"
  #include "NewPing.h"
  #include "Adafruit_Sensor.h"



  // Pin Definitions
  #define DHT_PIN_DATA 2
  #define HCSR04_PIN_TRIG 4
  #define HCSR04_PIN_ECHO 3
  #define IROBJAVOID_1_PIN_OUT 5
  #define IROBJAVOID_2_PIN_OUT 6
  #define IROBJAVOID_3_PIN_OUT 7
  #define IROBJAVOID_4_PIN_OUT 8



  // Global variables and defines

  // object initialization

  DHT dht(DHT_PIN_DATA);
  NewPing hcsr04(HCSR04_PIN_TRIG,HCSR04_PIN_ECHO);



  // define vars for testing menu
  const int timeout = 10000;       //define timeout of 10 sec
  char menuOption = 0;
  long time0;
  float ax, ay, az;
  char menu()
  {

      Serial.println(F("\nWhich component would you like to test?"));
      Serial.println(F("(1) DHT22/11 Humidity and Temperature Sensor"));
      Serial.println(F("(2) Ultrasonic Sensor - HC-SR04"));
      Serial.println(F("(3) IR Obstacle Avoidance Sensor #1"));
      Serial.println(F("(4) IR Obstacle Avoidance Sensor #2"));
      Serial.println(F("(5) IR Obstacle Avoidance Sensor #3"));
      Serial.println(F("(6) IR Obstacle Avoidance Sensor #4"));
      Serial.println(F("(7) Accelerometer onboard sensor"));
      Serial.println(F("(menu) send anything else or press on board reset button\n"));
      while (!Serial.available());

      // Read data from serial monitor if received
      while (Serial.available())
      {
          char c = Serial.read();
          if (isAlphaNumeric(c))
          {
              if(c == '1')
       Serial.println(F("Now Testing DHT22/11 Humidity and Temperature Sensor"));
       else if(c == '2')
       Serial.println(F("Now Testing Ultrasonic Sensor - HC-SR04"));
       else if(c == '3')
       Serial.println(F("Now Testing IR Obstacle Avoidance Sensor #1"));
       else if(c == '4')
       Serial.println(F("Now Testing IR Obstacle Avoidance Sensor #2"));
       else if(c == '5')
       Serial.println(F("Now Testing IR Obstacle Avoidance Sensor #3"));
       else if(c == '6')
       Serial.println(F("Now Testing IR Obstacle Avoidance Sensor #4"));\
          else if(c == '7'){
            Serial.print("a:\t");
            Serial.print(ax);
            Serial.print("\t");
            Serial.print(ay);
            Serial.print("\t");
            Serial.print(az);
            Serial.println();
          }
              else
              {
                  Serial.println(F("illegal input!"));
                  return 0;
              }
              time0 = millis();
              return c;
          }
      }
  }
  // Setup the essentials for your circuit to work. It runs first every time your circuit is powered with electricity.


void setup() {
  Serial.begin(921600); // initialize Serial communication
  while (!Serial); // wait for serial port to connect. Needed for native USB
  Serial.println("start");

  dht.begin();
  CurieIMU.begin();

  // Set the accelerometer range to 2G
  CurieIMU.setAccelerometerRange(2);
  Serial.println("Initializing IMU device...");
  pinMode(IROBJAVOID_1_PIN_OUT, INPUT);
  pinMode(IROBJAVOID_2_PIN_OUT, INPUT);
  pinMode(IROBJAVOID_3_PIN_OUT, INPUT);
  pinMode(IROBJAVOID_4_PIN_OUT, INPUT);
  menuOption = menu();    // wait for the serial port to open

  // initialize device


}

void loop() {
  if(menuOption == '1') {
  // DHT22/11 Humidity and Temperature Sensor - Test Code
  // Reading humidity in %
  float dhtHumidity = dht.readHumidity();
  // Read temperature in Celsius, for Fahrenheit use .readTempF()
  float dhtTempC = dht.readTempC();
  Serial.print(F("Humidity: ")); Serial.print(dhtHumidity); Serial.print(F(" [%]\t"));
  Serial.print(F("Temp: ")); Serial.print(dhtTempC); Serial.println(F(" [C]"));

  }
  else if(menuOption == '2') {
  // Ultrasonic Sensor - HC-SR04 - Test Code
  // Read distance measurment from UltraSonic sensor
  int hcsr04Dist = hcsr04.ping_cm();
  delay(10);
  Serial.print(F("Distance: ")); Serial.print(hcsr04Dist); Serial.println(F("[cm]"));

  }
  else if(menuOption == '3') {
  // IR Obstacle Avoidance Sensor #1 - Test Code
  //Read IR obstacle Sensor. irObjAvoid_1Var will be '1' if an Obstacle was detected
  //Use the onboard trimmer to set the distance of alert
  bool irObjAvoid_1Var = !digitalRead(IROBJAVOID_1_PIN_OUT);
  Serial.print(F("ObjAvoid: ")); Serial.println(irObjAvoid_1Var);

  }
  else if(menuOption == '4') {
  // IR Obstacle Avoidance Sensor #2 - Test Code
  //Read IR obstacle Sensor. irObjAvoid_2Var will be '1' if an Obstacle was detected
  //Use the onboard trimmer to set the distance of alert
  bool irObjAvoid_2Var = !digitalRead(IROBJAVOID_2_PIN_OUT);
  Serial.print(F("ObjAvoid: ")); Serial.println(irObjAvoid_2Var);

  }
  else if(menuOption == '5') {
  // IR Obstacle Avoidance Sensor #3 - Test Code
  //Read IR obstacle Sensor. irObjAvoid_3Var will be '1' if an Obstacle was detected
  //Use the onboard trimmer to set the distance of alert
  bool irObjAvoid_3Var = !digitalRead(IROBJAVOID_3_PIN_OUT);
  Serial.print(F("ObjAvoid: ")); Serial.println(irObjAvoid_3Var);

  }
  else if(menuOption == '6') {
  // IR Obstacle Avoidance Sensor #4 - Test Code
  //Read IR obstacle Sensor. irObjAvoid_4Var will be '1' if an Obstacle was detected
  //Use the onboard trimmer to set the distance of alert
  bool irObjAvoid_4Var = !digitalRead(IROBJAVOID_4_PIN_OUT);
  Serial.print(F("ObjAvoid: ")); Serial.println(irObjAvoid_4Var);

  }
  else if(menuOption == '7'){
       //scaled accelerometer values
    CurieIMU.readAccelerometerScaled(ax, ay, az);
  }




  if (millis() - time0 > timeout)
  {
      menuOption = menu();
  }
}

Why is it so damned difficult for you to use Tools + Auto Format? #define statements should NOT be indented.

Put EVERY { on a line BY ITSELF.
Put EVERY } on a line BY ITSELF.
Use Tools + Auto Format.

Do NOT post ANY more code unless you can do that.

There are two places in your code where it makes sense to use the switch/case statement instead of a string of if/else statements:

      switch (c)
      {
        case '1':
          Serial.println(F("Now Testing DHT22/11 Humidity and Temperature Sensor"));
          break;

        case '2':
          Serial.println(F("Now Testing Ultrasonic Sensor - HC-SR04"));
          break;

        case '3':
          Serial.println(F("Now Testing IR Obstacle Avoidance Sensor #1"));
          break;

        case '4':
          Serial.println(F("Now Testing IR Obstacle Avoidance Sensor #2"));
          break;

        case '5':
          Serial.println(F("Now Testing IR Obstacle Avoidance Sensor #3"));
          break;

        case '6':
          Serial.println(F("Now Testing IR Obstacle Avoidance Sensor #4"));
          break;

        case '7':
          Serial.print("a:\t");
          Serial.print(ax);
          Serial.print("\t");
          Serial.print(ay);
          Serial.print("\t");
          Serial.print(az);
          Serial.println();
          break;

        default:
          Serial.println(F("illegal input!"));
          return 0;
      }
  switch (menuOption)
  {
    case '1':
      // DHT22/11 Humidity and Temperature Sensor - Test Code
      // Reading humidity in %
      float dhtHumidity = dht.readHumidity();
      // Read temperature in Celsius, for Fahrenheit use .readTempF()
      float dhtTempC = dht.readTempC();
      Serial.print(F("Humidity: "));
      Serial.print(dhtHumidity);
      Serial.print(F(" [%]\t"));
      Serial.print(F("Temp: "));
      Serial.print(dhtTempC);
      Serial.println(F(" [C]"));
      break;

    case '2':
      // Ultrasonic Sensor - HC-SR04 - Test Code
      // Read distance measurment from UltraSonic sensor
      int hcsr04Dist = hcsr04.ping_cm();
      delay(10);
      Serial.print(F("Distance: "));
      Serial.print(hcsr04Dist);
      Serial.println(F("[cm]"));
      break;

    case '3':
      // IR Obstacle Avoidance Sensor #1 - Test Code
      //Read IR obstacle Sensor. irObjAvoid_1Var will be '1' if an Obstacle was detected
      //Use the onboard trimmer to set the distance of alert
      bool irObjAvoid_1Var = !digitalRead(IROBJAVOID_1_PIN_OUT);
      Serial.print(F("ObjAvoid: "));
      Serial.println(irObjAvoid_1Var);
      break;

    case '4':
      // IR Obstacle Avoidance Sensor #2 - Test Code
      //Read IR obstacle Sensor. irObjAvoid_2Var will be '1' if an Obstacle was detected
      //Use the onboard trimmer to set the distance of alert
      bool irObjAvoid_2Var = !digitalRead(IROBJAVOID_2_PIN_OUT);
      Serial.print(F("ObjAvoid: ")); Serial.println(irObjAvoid_2Var);
      break;

    case '5':
      // IR Obstacle Avoidance Sensor #3 - Test Code
      //Read IR obstacle Sensor. irObjAvoid_3Var will be '1' if an Obstacle was detected
      //Use the onboard trimmer to set the distance of alert
      bool irObjAvoid_3Var = !digitalRead(IROBJAVOID_3_PIN_OUT);
      Serial.print(F("ObjAvoid: ")); Serial.println(irObjAvoid_3Var);
      break;

    case '6':
      // IR Obstacle Avoidance Sensor #4 - Test Code
      //Read IR obstacle Sensor. irObjAvoid_4Var will be '1' if an Obstacle was detected
      //Use the onboard trimmer to set the distance of alert
      bool irObjAvoid_4Var = !digitalRead(IROBJAVOID_4_PIN_OUT);
      Serial.print(F("ObjAvoid: ")); Serial.println(irObjAvoid_4Var);
      break;

    case '7':
      //scaled accelerometer values
      CurieIMU.readAccelerometerScaled(ax, ay, az);
      break;
  }

When you have a cascade of if/else statements where an integer variable (char, int, long) is compared to a series of integer constants (including character constants) you should probably use a switch/case statement instead. They tend to be easier to read.

I know i am asking a lot but could someone please write the code out as i am getting more and more confused.

I know i am asking a lot

Too much. You don't seem to be putting ANY effort into the project.

I am will put effort but i have no clue what is going on, i don't have a degree in software engineering and i very confused. if no one can write out the code could they at least tell me what part off my code is wrong and they could lead me into a new path.

could they at least tell me what part off my code is wrong

You've been told. You have functions defined in other functions. That is not allowed. You won't make any effort to properly indent your code, so you can't even see that.

It takes ZERO effort to click on the Tools menu, drag the mouse down to the Auto Format option, and click. But, can't even make that effort. I'd like to understand why not.

To clear stuff out:
if you check the code was fixed by me the first time and this is the second time i am asking for help, check the most recent code posted and i dont know how to auto format because i am usind platformIO on atom as my IDE

i dont know how to auto format because i am usind platformIO on atom as my IDE

Why? Use the Arduiino IDE until you KNOW what you are doing.

If you just can't, then you need to manually indent your code properly.

I am still having prob

I'm not going to guess what the prob is.

if u think i never give u the error messages u wrong everything is there and if u don’t want to help me, because i see u getting angry or irritated then u don’t have to help i am sorry if i have made u angry if my code doesn’t fall on specific lines. I downloaded the arduino IDE from the windows store and i formatted the code:

#include <Arduino.h>
#include "CurieIMU.h"
#include "DHT.h"
#include "DHT_U.h"
#include "NewPing.h"
#include "Adafruit_Sensor.h"



// Pin Definitions
#define DHT_PIN_DATA  2
#define HCSR04_PIN_TRIG 4
#define HCSR04_PIN_ECHO 3
#define IROBJAVOID_1_PIN_OUT  5
#define IROBJAVOID_2_PIN_OUT  6
#define IROBJAVOID_3_PIN_OUT  7
#define IROBJAVOID_4_PIN_OUT  8



// Global variables and defines

// object initialization

DHT dht(DHT_PIN_DATA);
NewPing hcsr04(HCSR04_PIN_TRIG, HCSR04_PIN_ECHO);



// define vars for testing menu
const int timeout = 10000;       //define timeout of 10 sec
char menuOption = 0;
long time0;
float ax, ay, az;
char menu()
{

  Serial.println(F("\nWhich component would you like to test?"));
  Serial.println(F("(1) DHT22/11 Humidity and Temperature Sensor"));
  Serial.println(F("(2) Ultrasonic Sensor - HC-SR04"));
  Serial.println(F("(3) IR Obstacle Avoidance Sensor #1"));
  Serial.println(F("(4) IR Obstacle Avoidance Sensor #2"));
  Serial.println(F("(5) IR Obstacle Avoidance Sensor #3"));
  Serial.println(F("(6) IR Obstacle Avoidance Sensor #4"));
  Serial.println(F("(7) Accelerometer onboard sensor"));
  Serial.println(F("(menu) send anything else or press on board reset button\n"));
  while (!Serial.available());

  // Read data from serial monitor if received
  while (Serial.available())
  {
    char c = Serial.read();
    if (isAlphaNumeric(c))
    {
      if (c == '1')
        Serial.println(F("Now Testing DHT22/11 Humidity and Temperature Sensor"));
      else if (c == '2')
        Serial.println(F("Now Testing Ultrasonic Sensor - HC-SR04"));
      else if (c == '3')
        Serial.println(F("Now Testing IR Obstacle Avoidance Sensor #1"));
      else if (c == '4')
        Serial.println(F("Now Testing IR Obstacle Avoidance Sensor #2"));
      else if (c == '5')
        Serial.println(F("Now Testing IR Obstacle Avoidance Sensor #3"));
      else if (c == '6')
        Serial.println(F("Now Testing IR Obstacle Avoidance Sensor #4")); \
      else if (c == '7') {
        Serial.print("a:\t");
        Serial.print(ax);
        Serial.print("\t");
        Serial.print(ay);
        Serial.print("\t");
        Serial.print(az);
        Serial.println();
      }
      else
      {
        Serial.println(F("illegal input!"));
        return 0;
      }
      time0 = millis();
      return c;
    }
  }
}
// Setup the essentials for your circuit to work. It runs first every time your circuit is powered with electricity.


void setup() {
  Serial.begin(921600); // initialize Serial communication
  while (!Serial); // wait for serial port to connect. Needed for native USB
  Serial.println("start");

  dht.begin();
  CurieIMU.begin();

  // Set the accelerometer range to 2G
  CurieIMU.setAccelerometerRange(2);
  Serial.println("Initializing IMU device...");
  pinMode(IROBJAVOID_1_PIN_OUT, INPUT);
  pinMode(IROBJAVOID_2_PIN_OUT, INPUT);
  pinMode(IROBJAVOID_3_PIN_OUT, INPUT);
  pinMode(IROBJAVOID_4_PIN_OUT, INPUT);
  menuOption = menu();    // wait for the serial port to open

  // initialize device


}

void loop() {
  if (menuOption == '1') {
    // DHT22/11 Humidity and Temperature Sensor - Test Code
    // Reading humidity in %
    float dhtHumidity = dht.readHumidity();
    // Read temperature in Celsius, for Fahrenheit use .readTempF()
    float dhtTempC = dht.readTempC();
    Serial.print(F("Humidity: ")); Serial.print(dhtHumidity); Serial.print(F(" [%]\t"));
    Serial.print(F("Temp: ")); Serial.print(dhtTempC); Serial.println(F(" [C]"));

  }
  else if (menuOption == '2') {
    // Ultrasonic Sensor - HC-SR04 - Test Code
    // Read distance measurment from UltraSonic sensor
    int hcsr04Dist = hcsr04.ping_cm();
    delay(10);
    Serial.print(F("Distance: ")); Serial.print(hcsr04Dist); Serial.println(F("[cm]"));

  }
  else if (menuOption == '3') {
    // IR Obstacle Avoidance Sensor #1 - Test Code
    //Read IR obstacle Sensor. irObjAvoid_1Var will be '1' if an Obstacle was detected
    //Use the onboard trimmer to set the distance of alert
    bool irObjAvoid_1Var = !digitalRead(IROBJAVOID_1_PIN_OUT);
    Serial.print(F("ObjAvoid: ")); Serial.println(irObjAvoid_1Var);

  }
  else if (menuOption == '4') {
    // IR Obstacle Avoidance Sensor #2 - Test Code
    //Read IR obstacle Sensor. irObjAvoid_2Var will be '1' if an Obstacle was detected
    //Use the onboard trimmer to set the distance of alert
    bool irObjAvoid_2Var = !digitalRead(IROBJAVOID_2_PIN_OUT);
    Serial.print(F("ObjAvoid: ")); Serial.println(irObjAvoid_2Var);

  }
  else if (menuOption == '5') {
    // IR Obstacle Avoidance Sensor #3 - Test Code
    //Read IR obstacle Sensor. irObjAvoid_3Var will be '1' if an Obstacle was detected
    //Use the onboard trimmer to set the distance of alert
    bool irObjAvoid_3Var = !digitalRead(IROBJAVOID_3_PIN_OUT);
    Serial.print(F("ObjAvoid: ")); Serial.println(irObjAvoid_3Var);

  }
  else if (menuOption == '6') {
    // IR Obstacle Avoidance Sensor #4 - Test Code
    //Read IR obstacle Sensor. irObjAvoid_4Var will be '1' if an Obstacle was detected
    //Use the onboard trimmer to set the distance of alert
    bool irObjAvoid_4Var = !digitalRead(IROBJAVOID_4_PIN_OUT);
    Serial.print(F("ObjAvoid: ")); Serial.println(irObjAvoid_4Var);

  }
  else if (menuOption == '7') {
    //scaled accelerometer values
    CurieIMU.readAccelerometerScaled(ax, ay, az);
  }




  if (millis() - time0 > timeout)
  {
    menuOption = menu();
  }
}

if u think i never give u the error messages u wrong

Tell me which reply. It would have to be one after #3 where you added "still having prob" to the title, since there are no error messages there.

and if u never get the error messages:

DHT.cpp:(.text._ZN3DHTC2Ehhh+0x0): multiple definition of `DHT::DHT(unsigned char, unsigned char, unsigned char)'

.pioenvs\genuino101\lib4fb\libDHT sensor library_ID19.a(DHT.cpp.o):DHT.cpp:(.text._ZN3DHTC2Ehhh+0x0): first defined here
.pioenvs\genuino101\libd55\libFirmware.a(DHT.cpp.o): In function DHT::begin()': DHT.cpp:(.text._ZN3DHT5beginEv+0x0): multiple definition of DHT::begin()'
.pioenvs\genuino101\lib4fb\libDHT sensor library_ID19.a(DHT.cpp.o):DHT.cpp:(.text._ZN3DHT5beginEv+0x0): first defined here
.pioenvs\genuino101\libd55\libFirmware.a(DHT.cpp.o): In function DHT::convertCtoF(float)': DHT.cpp:(.text._ZN3DHT11convertCtoFEf+0x0): multiple definition of DHT::convertCtoF(float)'
.pioenvs\genuino101\lib4fb\libDHT sensor library_ID19.a(DHT.cpp.o):DHT.cpp:(.text._ZN3DHT11convertCtoFEf+0x0): first defined here
.pioenvs\genuino101\libd55\libFirmware.a(DHT.cpp.o): In function DHT::convertFtoC(float)': DHT.cpp:(.text._ZN3DHT11convertFtoCEf+0x0): multiple definition of DHT::convertFtoC(float)'
.pioenvs\genuino101\lib4fb\libDHT sensor library_ID19.a(DHT.cpp.o):DHT.cpp:(.text._ZN3DHT11convertFtoCEf+0x0): first defined here
.pioenvs\genuino101\libd55\libFirmware.a(DHT.cpp.o): In function DHT::computeHeatIndex(float, float, bool)': DHT.cpp:(.text._ZN3DHT16computeHeatIndexEffb+0x0): multiple definition of DHT::computeHeatIndex(float, float, bool)'
.pioenvs\genuino101\lib4fb\libDHT sensor library_ID19.a(DHT.cpp.o):DHT.cpp:(.text._ZN3DHT16computeHeatIndexEffb+0x0): first defined here
.pioenvs\genuino101\libd55\libFirmware.a(DHT.cpp.o): In function DHT::expectPulse(bool)': DHT.cpp:(.text._ZN3DHT11expectPulseEb+0x0): multiple definition of DHT::expectPulse(bool)'
.pioenvs\genuino101\lib4fb\libDHT sensor library_ID19.a(DHT.cpp.o):DHT.cpp:(.text._ZN3DHT11expectPulseEb+0x0): first defined here
.pioenvs\genuino101\libd55\libFirmware.a(DHT.cpp.o): In function DHT::read(bool)': DHT.cpp:(.text._ZN3DHT4readEb+0x0): multiple definition of DHT::read(bool)'
.pioenvs\genuino101\lib4fb\libDHT sensor library_ID19.a(DHT.cpp.o):DHT.cpp:(.text._ZN3DHT4readEb+0x0): first defined here
.pioenvs\genuino101\libd55\libFirmware.a(DHT.cpp.o): In function DHT::readTemperature(bool, bool)': DHT.cpp:(.text._ZN3DHT15readTemperatureEbb+0x0): multiple definition of DHT::readTemperature(bool, bool)'
.pioenvs\genuino101\lib4fb\libDHT sensor library_ID19.a(DHT.cpp.o):DHT.cpp:(.text._ZN3DHT15readTemperatureEbb+0x0): first defined here
.pioenvs\genuino101\libd55\libFirmware.a(DHT.cpp.o): In function DHT::readHumidity(bool)': DHT.cpp:(.text._ZN3DHT12readHumidityEb+0x0): multiple definition of DHT::readHumidity(bool)'
.pioenvs\genuino101\lib4fb\libDHT sensor library_ID19.a(DHT.cpp.o):DHT.cpp:(.text._ZN3DHT12readHumidityEb+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
*** [.pioenvs\genuino101\firmware.elf] Error 1
[ERROR] Took 4.47 seconds

You appear to be compiling two instances of the DHT class.

  #include "DHT.h"
  #include "DHT_U.h"

Why are you including both of these? You should only be including one of them.

okay i am sorry could u pls help my problems

People will only try to help you if you try to help yourself. So post your (properly indented) code after you have attempted to fix it. Nobody here is going to do it for you.

Linter
Severity    Provider    Description   Line 
Error   GCC   DHT.h: No such file or directory   42:19
Error   Build   error: no matching function for call to 'DHT::DHT(int)'e   62:23
Error   Build   error: 'menu' was not declared in this scopee   90:21
Error   Build   error: 'class DHT' has no member named 'readTempC'e   103:24
Error   Build   error: 'menu' was not declared in this scopee   158:25
Error   Build   error: a function-definition is not allowed here before '{' tokene   162:3
Error   Build   error: expected '}' at end of inpute   211:3
PIO Buildsrc\main.cpp7001:1(211, 6468)
CRLFUTF-8C++GitHubGit (0)

i think you don't have install DNT libraries and you did not "int" menu make it as a subject or something and 211:3 your input below did not put } or something and your libraries is stacking . You need to learn how to read the fault message so that you can troubleshooting your coding