Okay so how do I do data type conversions? I think it’ such a basic question that I’m worried I’m asking a dumb question.
I want to publish a boolean value (a door is open or closed). So I can get the value of the sensor on the door by checking variable = digitalRead(D0). But when I publish the value I want to do spark.publish(“variable”, variable).
Variable must be declared as: int variable=0; but the datatype of the publish function is char* how do I convert?
seems like it should work to me but it won’t even verify. I get an error with the char data type declaration at the top, and the string data type which works on arduino, and I get an error on converting to string.