From the coding guide, I find that it is possible to pass multiple values through in one pson data. But when I try to set the values on my dashboard through a slider, I can only access the Resource “user_input” instead of the values “a” and “s”, so I cannot change them properly.
I know that I can separate them into two resources and send them separately, but is there any ways to put them together and control them through sliders?
Here are my code and the snapshot for the slider settings
thing["user_input"] << [](pson& in)
{
if(in["a"].is_empty()) //avoid slider reset when input is not available
{
in["a"]= (int) A;
}
else
{
if(A!= (int)in["a"])
{
int new_a = (int) in["a"];
A = new_a;
Serial.println(A);
}
}
if(in["s"].is_empty()) //avoid slider reset when input is not available
{
in["s"]= (int) S;
}
else
{
if(S!= (int)in["s"])
{
int new_s = (int) in["s"];
S = new_s;
Serial.println(S);
}
}
};