Using two or more Voltage sensors for recording Battery Data

Hello Arduino Community!

I am recently trying a mini project in refreshing my coding skills. I am trying to input two or more Voltage sensors in one Arduino board and trying to get the values displayed in my 16x2 LCD I2C display.

I am not aware of how to integrate the same coding of the 1st Voltage sensor to the second followed by the other. Please do help me out people....

#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);

#define Sensor1 A0
#define Sensor2 A1

float vOUT = 0.0;
float vIN = 0.0;
float R1 = 30000.0;
float R2 = 7500.0;

void setup() {
Serial.begin(9600);
lcd.init();
lcd.backlight();
lcd.setCursor(2, 0);
lcd.print("CELLEX Tech");
lcd.setCursor(0, 1);
lcd.print("VOLTAGE SENSOR..");
delay(3000);
lcd.clear();

}

void loop() {
int value = analogRead(Sensor1);
vOUT = (value * 5.0) / 1024.0;
vIN = vOUT / (R2 / (R1 + R2));

lcd.setCursor(0,0);
lcd.print(vIN);
lcd.print("v ");
Serial.print("Voltage : ");
Serial.println(vIN);

int value = analogRead(Sensor2);
vOUT = (value * 5.0) / 1024.0;
vIN = vOUT / (R4 / (R3 + R4));

lcd.setCursor(7,0);
lcd.print(vIN);
lcd.print("v ");
Serial.print("Voltage : ");
Serial.println(vIN);
}

Please do help me out with the above sketch

Welcome to the forum

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination

Help us help you.