codeing for lcd voltmeter *URGENT*

#include <LCD4Bit.h>

LCD4Bit lcd = LCD4Bit(2);

int analogPin = 3; // potentiometer wiper (middle terminal) connected to analog pin 3
// outside leads to ground and +5V
int val = 0; // variable to store the value read

void setup()
pinMode(13, OUTPUT); //we’ll use the debug LED to output a heartbeat

//optionally, now set up our application-specific display settings, overriding whatever the lcd did in lcd.init()
//lcd.commandWrite(0x0F);//cursor on, display on, blink on. (nasty!)

Serial.begin(9600); // setup serial

void loop()

val = analogRead(analogPin); // read the input pin
Serial.println(val); // debug value



this is my code for my lcd to print the voltage from pin 3 the val in the lcdprintin keeps giving me an error.

In function ‘void loop()’:
error: invalid conversion from ‘int’ to 'char*

What im tryin to do is take the value gotten from the analog pin a/d converter and print it to the lcd what code could i use to print the number to the screen.

The line in error is highlighted in the IDE. Without knowing the specific line in error, I'd guess that it's the lcd.printIn line. The printIn function takes an array of characters (also known as a char *), not an int. You are trying to call it with an int.

Use this:

char str[10];
sprintf(str, "%d", val);

The function name is not "printIn" with a capital i, but "println" with a lowercase L. As in "print a line." Otherwise, PaulS's fix is just right.

I looked before I responded. The LCD4Bit library has a printIn method (with a capital I). It takes a char array.

I stand corrected, PaulS. What a weird name. Not much in the way of docs. Is it "inverted" colors print?