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 LED ring logic #113

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

added LED ring logic #113

wants to merge 1 commit into from

Conversation

brushknight
Copy link
Contributor

No description provided.

Copy link
Member

@nicolabortignon nicolabortignon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current implementation is breaking the 'dimming after not engaging for longer than 5 seconds'

To reproduce:

  • go on an app that set a led_ring_notifier
  • set an app level custom led pattern
  • stop fiddingling with the app.
  • after 5 seconds the screen dims (depending on brightness sensor at different level).
  • leds stay on in the custom pattern that the app set.

Intended behaviour:

  • when disengaging with the knob, the experience should be the standard one (led control get handed off to the core task).
  • when re-engaging, the app level setting should be re-enstablished (showing the custom pattern on leds).

Not sure we if we need to have a more structure approach to the concept of 'sleeping' and app priorities. But it looks like that

  1. the app needs to know when the knob is being re-engaged ( so to reset up whatever experiences they left behind)
  2. the main 'os-ish' task should be able to take over an app led configuration

@@ -470,7 +475,14 @@ TFT_eSprite *LightDimmerApp::render()
adjusted_angle = right_bound;
}
spr_->fillSmoothCircle(TFT_WIDTH / 2 + (screen_radius - 10) * cosf(adjusted_angle), TFT_HEIGHT / 2 - (screen_radius - 10) * sinf(adjusted_angle), 5, dot_color, foreground_color);
led_ring_notifier->staticColorRange((255 << 16) | (127 << 8) | 0, 255, wanted_angle * 180 / PI, start_angle * 180 / PI + 5, LED_RING_PRIOTITY_APP);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a bit of comments to this line (ie.: what is 5 in the start_angle * 180 / PI + 5) so for posterity we don't waste to much time tracing it back

Copy link
Member

@nicolabortignon nicolabortignon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WhatsApp.Video.2024-04-08.at.08.34.39.mp4

There is a rounding bug (hopefully, not an hardware bug). Looks like similar to the one we had on the dot of the virtual dial.
Might be a good time to fix this at motor/hall sensor for good (ie.: when setting high number of detents, noise should be filtered out accordingly)

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