Touch Read function Compilation error: invalid conversion from 'char' to 'char*'

I am using ESP32 S3 - M5 STAMP S3 MC. I am trying to run the touch read function which is:

#include <stdio.h>
#include <string.h>
void setup()
{
  Serial.begin(115200);
  delay(1000);
  Serial.println("ESP32 Touch Test");
}
char msg(32);
int t1,t2;
void loop()
{
  t1 = touchRead(1);
  delay(1000);
  t2 = touchRead(2);
  sprintf(msg,"%d,%d",t1,t2);
  Serial.println(msg);
  delay(1000);
}

I am getting this error: Compilation error: invalid conversion from 'char' to 'char*' [-fpermissive]

What might be the reason?

Always show the complete error message please. Otherwise you make people guess where the error might have occurred. That's counterproductive.

I would imagine that

char msg(32);

should be

char msg[32];
2 Likes

i apologize..but it worked..thanks so much for speedy reply

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.