Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 3 commits into from

Conversation

JustMe-NL
Copy link
Contributor

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
Copy link
Collaborator

KlausMu commented Apr 22, 2024

Thanks for your PR. Need some more days. Still working on #76

@KlausMu
Copy link
Collaborator

KlausMu commented Apr 23, 2024

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
Copy link
Contributor Author

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

@KlausMu
Copy link
Collaborator

KlausMu commented Apr 27, 2024

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.

Sliders only support ranges from min to max but the slider visual and the setting to the IMU are reversed.
At the IMU we therefore store 0x7F, which is the maximum possible value, minus the slider value:
0x7F-0x3A = 0x45. So if the minimum IMU value is practically 0x40, the maximum slider value shuld be 0x3F.
We use a non signed variable so we only need to do a sanitycheck on the maximum slider value of 0x3F.
@JustMe-NL
Copy link
Contributor Author

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
Copy link
Collaborator

KlausMu commented Apr 28, 2024

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

  • which values you get from the slider
  • which values you save to the IMU
  • which values you store in the preferences

@JustMe-NL
Copy link
Contributor Author

Not abandoned but want to test it thoroughly this time.

@JustMe-NL JustMe-NL closed this Sep 28, 2024
@JustMe-NL
Copy link
Contributor Author

I’ll issue a new req. when I’m ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants