The value of slider position is stored in firebase as "lim:". This "lim" value can also be changed by the microcontroller. When the microcontroller changes this value, I tried to place the slider's position at that value. When I do this with the microcontroller, the position of the slider goes to the set value. No problem so far. Now when I change the sliders position in the app, it goes crazy like this in video. I sent the value to firebase from the microcontroller as both an int and a string, and the result is the same.
More detail
OK, let me tell you more.
1- I changed the slider position. The microcontroller read the changed value of the Slider from the firebase. no problem...
2- I changed this value from the value it left with the rotary encoder from the microcontroller. According to this new value, the position of the Slider has also changed. no problem.
3. Now I changed the Slider again. and he went crazy
Rotary encoder send the value when interrupt enabled .
It is sending the value at first. Depending on the value, the position of the slider also changes. no problem so far. Now the slider goes crazy when I change the slider.
Rotary encoder. It s like potentiometer that you changed the frequency a radio or volume up etc.
In order to stop a feedback loop, you need some way to mute the feedback for a certain amount of time.
That would involve adding a global true/false variable MUTED, checked by both events and required to be false before propagating an update.
You would also need a one shot nonrepeating Clock Timer to turn off the muting after a second.
Another alternative would be to keep a global variable with prior value(s), to help avoid unnecessary attempts to propagate changes. If the new value matches the old value, don't try to propagate it.
OK, let me tell you more.
1-I changed the slider position. The microcontroller read the changed value of the Slider from the firebase. no problem...
2- I changed this value from the value it left with the rotary encoder from the microcontroller. According to this new value, the position of the Slider has also changed. no problem.
3. Now I changed the Slider again. and he went crazy