-
Notifications
You must be signed in to change notification settings - Fork 1
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
SNS - Levitation Current Sensor #71
base: main
Are you sure you want to change the base?
SNS - Levitation Current Sensor #71
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a few things to tidy up
Rejigged the structure of the |
/// by the supply voltage divided by 2, so if you change the supply voltage, you'll have to change the offset that we subtract | ||
/// in the read function accordingly. | ||
pub fn read(&mut self) -> SensorValueRange<f32> { | ||
let current = self.adc.read_value() as f32; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to convert the value read on ADC into volts first (currently will be 0-4096)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that something that can be done as part of the adc implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getting the resolution of the ADC is being added in #82 if that's what you mean?
I guess we could also add functionality to map it to a given range (e.g. 0-3.3) too
init commit