0

I have written a simple code to read data from capacitive keypad and display it on LCD.

I am getting the data from keypad in following data structure.

char phoneNumber[PHONE_DIGITS];

and then displaying the data on LCD as

 LcdString(phoneNumber[i]);

where my LCD string function is

void LcdString(char *characters)
{
 while (*characters)
 {
 LcdCharacter(*characters++);
 }
}

There is a type cast error

error: invalid conversion from 'char' to 'char*' [-fpermissive]

How can I debug it?

asked May 7, 2016 at 10:51

1 Answer 1

1

You're calling your function with a single char, specified by phoneNumber[i], but your function is expecting an array.

If you change your call to:

LcdString(phonenumber)

then that will pass the entire array.

Are you trying to say that you're storing multiple phone numbers? i.e. a two dimensional array? Check out the String reference for more details: https://www.arduino.cc/en/Reference/String

answered May 7, 2016 at 12:05

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.