Skip to content

Flex Sensor Implementation #409

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

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Flex Sensor Implementation #409

wants to merge 12 commits into from

Conversation

gorbit99
Copy link
Contributor

@gorbit99 gorbit99 commented Mar 21, 2025

This PR continues the partial implementation of flex sensors into the firmware. This is done in 2 parts:

  1. For direct-to-pin sensors, it implements the remaining logic necessary.
  2. It implements the ADS1115 4 channel ADC multiplexer used by the V3 version of the SlimeVR glove.
  3. It implements a generic driver for parallel mux ICs, such as the 74hc4051 or 74hc4067.

In addition to the above changes, it refactors some of the logic behind ADC reading to make it more modular and make supporting future ICs easier.

Caveats:
The max reading rate of the ADS1115 ic is 680 reads per second, which is shared among the connected flex sensors, and it makes the microcontroller busywait for 1/680 seconds each read. Due to this I lowered down the max output rate of flex sensors to 60Hz to mitigate this issue. It might be wise to implement this limitation in the ADS1115 implementation instead if it turns out that 60Hz isn't nearly enough for these.

@gorbit99 gorbit99 requested a review from Eirenliel March 21, 2025 12:38
@gorbit99 gorbit99 changed the title Initial ADS111x implementation Flex Sensor Implementation Apr 5, 2025
@gorbit99 gorbit99 marked this pull request as ready for review April 5, 2025 00:39
@gorbit99 gorbit99 requested a review from loucass003 as a code owner April 5, 2025 00:39
Copy link
Member

@Eirenliel Eirenliel left a comment

Choose a reason for hiding this comment

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

Needs to be rebased

@gorbit99 gorbit99 marked this pull request as draft April 8, 2025 17:54
@gorbit99
Copy link
Contributor Author

gorbit99 commented Apr 8, 2025

Converting this to a draft, so I can implement parallel muxes first

@gorbit99 gorbit99 marked this pull request as ready for review April 22, 2025 16:29
@gorbit99 gorbit99 requested a review from Eirenliel April 22, 2025 16:29
@gorbit99
Copy link
Contributor Author

I'll update this after other PRs are merged

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