How do i connect a pressure sensor to an arduino???

Hi, I recently got a pressure sensor:CP24 / Nyomásérzékelő, 0,2-100N (IEE) - HESTORE - Elektronikai alkatrész kis- és nagykereskedelem
It only has 2 legs, so i dnot know wich is ground, 5v, and the data.
I'm trying to implement it in this code:

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Set the LCD address to 0x27 for a 16 chars and 2 line display
LiquidCrystal_I2C lcd(0x27, 16, 2);

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels

// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

void setup()
{

Serial.begin(115200);

  if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
    Serial.println(F("SSD1306 allocation failed"));
    for(;;);
  }
  // initialize the LCD
  lcd.begin();
  
  pinMode(13, OUTPUT);    // sets the digital pin 13 as output
  
  // Turn on the blacklight
  lcd.setBacklight((uint8_t)1);

lcd.print("Hello, world");
delay(1000);
lcd.clear();
lcd.print("Hello, world.");
delay(1000);
lcd.clear();
lcd.print("Hello, world..");
delay(1000);
lcd.clear();
lcd.print("Hello, world...");
delay(1000);
lcd.clear();

lcd.print("Oled inditasa...");
delay(random(1000,2000));
lcd.clear();
  display.clearDisplay();

  display.setTextSize(1.5);
  display.setTextColor(WHITE);
  display.setCursor(0, 10);
  // Display static text
  display.println("  Waiting for task...");
   display.println("  Waiting for task...");
    display.println("  Waiting for task...");
      display.println("  Waiting for task...");
        display.println("  Waiting for task...");
          display.println("  Waiting for task...");
  display.display();
delay(random(100,2000));

lcd.print("Hutes teszt...");
digitalWrite(13,HIGH);
delay(random(7000,10000));
digitalWrite(13,LOW);
lcd.clear();

lcd.print("Nyomas szenzor");
lcd.setCursor(0,1);
lcd.print("kalibralasa...");
delay(random(1000,5000));
lcd.clear();
lcd.setCursor(0,0);


digitalWrite(13,HIGH);

}

void loop()
{

}

It has a resistance that varies in accordance to the pressure. You will need to make a voltage divider and use analogRead to get a reading.

As it has only 2 leads it seems very likely that it acts as a variable resistor, so treat it as such.

Connect a 10K resistor to either leg of the sensor and the other end of the resistor to 5V, Connect the resistor/sensor join to an analogue input pin and the second leg of the sensor to GND

Use analogRead() to read the value returned by the selected analogue pin

However, this is just a guess on my part. Where did you get the sensor from and is a datasheet available ?

It came from: CP24 / Nyomásérzékelő, 0,2-100N (IEE) - HESTORE - Elektronikai alkatrész kis- és nagykereskedelem
And the datasheet is: https://www.hestore.hu/prod_getfile.php?id=8065

That confirms that it acts as a variable resistance

So it's like a button wiring? https://www.arduino.cc/en/tutorial/button

No. It is like LDR wiring.