やろうとしていること
ArduinoでMqtt Publishプログラムを作成しています。
topicの一部に、ボード上のSWの状態をリードした値を含めたいのですが、
方法が分からず困っております。
text
1invalid operands of types 'const char*' and 'const char [2]' to binary 'operator+'
C++
1 const char* topic = "test"; // Topic 2 int ID = digitalRead(SW) ; 3 Serial.printf("ID: %d\r\n", ID); 4 payload = "Hello"; 5 mqttClient.publish(topic+"/"+ID, payload);

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。