Controlling 2 servo motors with BMP180

But you haven't posted the code.

#include <SFE_BMP180.h>
#include <Wire.h>
#include <Servo.h>

int servoPin = 7;                 //Pin on which we will attach the servo
int absolute_pressure;             //The data we receive from the sensor
int pos = 0;

Servo motor;                      //Servo motor variant
SFE_BMP180 pressure;              ////Pressure sensor variant

#define ALTITUDE 30.0 // Altitude of Izmir in meters

void setup() {
  motor.attach(servoPin);                    //We associate our servo with pin 9.
  pinMode(absolute_pressure, INPUT);         //We set our sensor pin as input.
  pinMode(servoPin, OUTPUT);                 //We set our servo pin as input.


  if (pressure.begin())
    Serial.println("BMP180 init success");
    Serial.println("BMP180 init fail\n\n");

void loop() {
  absolute_pressure = analogRead(4);  //We are reading from the sensor.

  if (absolute_pressure<=1010) {          //If the pressure is less than or equal to 1000 mb, the command inside are executed.
    for (pos = 0; pos <= 5; pos += 1)

  if (absolute_pressure>1010)  {
    for (pos = 5; pos >= 0; pos -= 1)     //If the pressure is more than 1000 mb, the command inside are executed.
;  }
  else {                          


  char status;
  double T,P,p0,a;

  Serial.print("provided altitude: ");
  Serial.print(" meters, ");

  status = pressure.startTemperature();
  if (status != 0)

    status = pressure.getTemperature(T);
    if (status != 0)
      Serial.print("temperature: ");
      Serial.print(" deg C, ");
     status = pressure.startPressure(3);
      if (status != 0)

        status = pressure.getPressure(P,T);
        if (status != 0)
          Serial.print("absolute pressure: ");
          Serial.print(" mb, ");
          Serial.println(" Pa");

        else Serial.println("error retrieving pressure measurement\n");
      else Serial.println("error starting pressure measurement\n");
    else Serial.println("error retrieving temperature measurement\n");
  else Serial.println("error starting temperature measurement\n");

  delay(5000);  // Pause for 5 seconds.
  absolute_pressure = analogRead(4);  //We are reading from the sensor.`

Not a prize winning entry.

Start over with your project by learning to read the BMP180 using the library functions and simple examples provided.

The device attached to A4 (aka 4) is incapable of being read using analogRead.

I don't know how many more ways I can state this.

You have library code that reads the pressure and puts it in a variable.
Expand on that.

I totally understand that the sensor cannot read using analogRead. How can it be read then? I am asking because I don't know. That is why I have stated at the beginning as below.

If there is no way, then ok. If there is a way to do it, please share it with me. I want to learn and I totally appreciate your support. But It is not helping when you only say "you cannot read".

You have posted code that reads the temperature and the pressure - I don't understand how you cannot see this.

Please study this Arduino BMP180 tutorial

I didn't write the code of pressure sensor. I took it from an example project.

But it produced valid results, up there in reply #3, four hours ago.
What's wrong with using those results?

I still can get these values properly. The pressure value is increasing when I apply force on the sensor with my finger. I can see the deviation on the serial port screen. There is no problem with it.

The problem is that the servo is not receiving this pressure change. The servo is working, but it is not working according to the command defined (absolute_pressure>1010, absolute_pressure<=1010).

I used this code exactly in the code where I want to control the servo with BMP180. I can run both of them separately. But I want them to work together.

I can see no code that you have posted that uses the pressure value read via the BMP library to drive the servo.
(There was another massive hint in that last sentence)