Hi,
on my photon I want to check in seqence if a connected button was pressed by using this function alls:
89 buttonPressed(BTN_A0, "SparkCoreController/Command", "DOWN");
90 buttonPressed(BTN_A1, "SparkCoreController/Command", "LEFT");
91 buttonPressed(BTN_A2, "SparkCoreController/Command", "UP");
...
The function looks like this:
108 void buttonPressed(int button, char topic[], char command[]) {
109 // if button has been pressed
110 if(digitalRead(button) == LOW) {
111 client.publish(topic, command);
112 }
113 }
When verifying the code, I get the following error:
89:68: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings]
client.publish(“SparkCoreController/Init”, “Connected to broker.”);
I am very new to partice and Arduino.
It would be highly appreciated if someone could help me fix this.
Thanks