Display a few analog inputs on LCD

Hi
I have searched here and on Internet but have not found any help for my question.
Hopefully someone here can help me ?
I have 3 Analog Inputs(A0, A1, A2) to my Arduino, that I will show on my LCD (20x4) but I can´t figure out how to make it working.
(I have make it working to display to serial.monitor)

Hi

val = analogRead(analogpin);

this code will get the analoginput

lcd.print(val);

will print the val on the LCD

Thanks But how to show my 3 analog inputs ? A0 A1 A 2

Regards,

Here is my working sketch that shows the 3 values to serial.print

// 20A bi-directional ACS712

int sensorPin = A0; // the pin that the sensor is connected to
int voltagePin1 = A1; // pin connected to voltage divider(pick which pin you wish to use)
float voltage1;       // variable to store voltage value
int voltagePin2 = A2; // pin connected to voltage divider(pick which pin you wish to use)
float voltage2;       // variable to store voltage value

// YOUR calibration
float offset = 513.0; // zeroing bi-directional sensor | could be 510.0 to 513.0
float span = 0.05883; // span | depends on type of sensor used (e.g. 20A) | finetune max readout

const byte numReadings = 32; // number of readings for smoothing (max 64)
int readings[numReadings]; // raw A/D readings
byte index = 0; // index of the current reading
unsigned int total = 0; // running total
float current; // resulting current

void setup() {
  Serial.begin(115200); // ***set serial monitor to this value***
  for (index = 0; index < numReadings; index++) { // fast-fill the array at startup
    readings[index] = analogRead(sensorPin);
    total = total + readings[index];
  }
  index = 0; // reset index
}

void loop() {
  total = total - readings[index]; // subtract the last reading
  readings[index] = analogRead(sensorPin); // one unused reading to clear any ghost charge
  readings[index] = analogRead(sensorPin); // read the sensor
  total = total + readings[index]; // add the reading to the total
  index = index + 1; // advance to the next position in the array
  if (index >= numReadings) // if we're at the end of the array
    index = 0; // wrap around to the beginning

  // convert value to current
  current = (total / numReadings - offset) * span; // value to current conversion
  
  // volt
  voltage1 = analogRead(voltagePin1);  // Read voltagePin1
  voltage1 = (voltage1*15.45)/1024.0;   // calculates actual voltage

  voltage2 = analogRead(voltagePin2);  // Read voltagePin2
  voltage2 = (voltage2*15.45)/1024.0;   // calculates actual voltage
  
  // print to serial monitor
  Serial.print("Current is ");
  Serial.print(current); // default two decimal places | ...(current, 1);  is one decimal place
  Serial.print(" Amp   "); // CHANGED to Serial.print
  Serial.print("BatteryVoltage is ");
  Serial.print(voltage1); 
  Serial.print(" Volts    ");
  Serial.print("SunVoltage is ");
  Serial.print(voltage2); 
  Serial.println(" Volts     ");  // end of line

  delay(100); // use a non-blocking delay when combined with other code
}

gnagis: Thanks But how to show my 3 analog inputs ? A0 A1 A 2

Regards,

Read the 3 values into 3 variables. Position the LCD cursor and print the first value Position the LCD cursor and print the second value Position the LCD cursor and print the third value

There are neater ways to do it but try that first.

Can you please help me to write my sketch ?

What sort of lCD do you have ? Can you write to the screen ? Does your LCD library have any examples ?

Yes, I can write to LCD using th Examples so it´s connected in the right way toArduino. It´s a 20x4 display

Add an instance of the LCD to your existing program. Copy the code from the LCD example. Add commands to write to the LCD in this portion of your

  Serial.print("Current is ");
  Serial.print(current); // default two decimal places | ...(current, 1);  is one decimal place
  Serial.print(" Amp   "); // CHANGED to Serial.print
  Serial.print("BatteryVoltage is ");
  Serial.print(voltage1); 
  Serial.print(" Volts    ");
  Serial.print("SunVoltage is ");
  Serial.print(voltage2); 
  Serial.println(" Volts     ");  // end of line

  lcd.setCursor(0, 0);
  lcd.print(current);
  lcd.setCursor(0, 1);
  lcd.print(voltage1);
  lcd.setCursor(0, 2);
  lcd.print(voltage2);

Change cursor positions and/or add text labels as required.

Thanks a lot ! Now I get my values on the LCD :-)