Start a new topic

sendCommand("dim")

I want to send "dim value" on the first opening.


Exapmle;


byte light = eprom read  (example light = 75)


String light_str = String(light); 


light_str = "dim=" + light_str;


sendCommand(light_str);


But fault message:


cannot convert 'String' to 'const char*' for argument '1' to 'void sendCommand(const char*)'


Arduino.cc Reference

https://www.arduino.cc/en/Reference/HomePage


https://www.arduino.cc/en/Reference/StringObject

String light_str is using Object library of String


https://www.arduino.cc/en/Reference/String

string light_str would use char array


Reference and Dereferencing Operators

https://www.arduino.cc/en/Reference/Pointer

Also you can refer to 

Iteadlib Arduino Nextion Library  NexText.cpp

NexText::setText function shows how to use String (StringObject)

Login or Signup to post a comment