CoretechR / OMOTE

Open Source Remote Using ESP32 and LVGL
https://hackaday.io/project/191752
GNU General Public License v3.0
1.02k stars 114 forks source link

Added slider to settings gui for adjusting wake up sensitivity #80

Open JustMe-NL opened 2 months ago

JustMe-NL commented 2 months ago

The settings page now has an added slider with which you can adjust the sensitivity of movement detection for waking up Omote. After adjusting the slider the changes take effect when Omote falls to sleep again.

The greater the value of the slider (the more you slide it to the right), the more sensitive Omote is for movement to wake it up again.

KlausMu commented 2 months ago

Thanks for your PR. Need some more days. Still working on https://github.com/CoretechR/OMOTE/discussions/76

KlausMu commented 2 months ago

I tested it on my OMOTE. Values bigger than let's say 50% of the slider are not really usable, bause the OMOTE immediately wakes up, without any movement.

Default from @CoretechR was 0x45, which is already quite sensitive. I would limit the values that can be set between 0x7F (slider at left position) to 0x40 (slider at the right position). Everything less than 0x40 should not be allowed. What do you think?

And it should be checked if there is already a value in preferences. If not, the old default of 0x45 should be used. Currently 0x7F is used as default, which is very low sensitivity.

JustMe-NL commented 2 months ago

Ok, I’ll add a default in preferences for 0x45 and set the minimum to 0x40.

KlausMu commented 2 months ago

Does this really work for you?

Old default value: 0x45

First version of PR: slider left: 0x7F -> sensitivity very low, but works slider right: 0x00 -> much to sensitive, OMOTE immediately wakes up without movement

Second version of PR: slider left: 0x3F -> much to sensitive, OMOTE immediately wakes up without movement slider right: 0x00 -> much to sensitive, OMOTE immediately wakes up without movement

Values that are written to the IMU should be between 0x7F and 0x40. Now they are between 0x3F and 0x00.

JustMe-NL commented 2 months ago

Should be fixed now, the threshold of the IMU will be set to: slider left: 0x7F (0x7F-0x00), least sensitive slider right: 0x40 (0x7F-0x3F), most sensitive default value is no preference set: 0x45

KlausMu commented 2 months ago

Sorry, but this still does not work. Could you please test it?

This cannot work:

 lv_slider_set_range(thslider, 0, 0x3F);
  if (slider_value < 0x40)  {slider_value = 0x40;}
  if (slider_value > 0x7F) {slider_value = 0x7F;}

-> now you ALWAYS have 0x40 as slider value

if (awakeupByIMUthreshold > 0x3F) awakeupByIMUthreshold = 0x3F;

-> now you ALWAYS have 0x3F as threshold value.

Please test with Serial.print

JustMe-NL commented 1 month ago

Not abandoned but want to test it thoroughly this time.