pub struct PhSensor {
pub addr: u8,
pub cal_1: CalPt,
pub cal_2: CalPt,
pub cal_3: Option<CalPt>,
}Fields§
§addr: u8§cal_1: CalPt§cal_2: CalPt§cal_3: Option<CalPt>Implementations§
Source§impl PhSensor
impl PhSensor
pub fn new() -> Self
Sourcepub fn new_alt_addr() -> Self
pub fn new_alt_addr() -> Self
Create a new sensor with an ADC I2C address of 0x49.
Sourcepub fn cal_nitrate_default(&mut self)
pub fn cal_nitrate_default(&mut self)
Set calibration to a sensible default for nitrate, with unit mg/L
Sourcepub fn cal_phosphate_default(&mut self)
pub fn cal_phosphate_default(&mut self)
Set calibration to a sensible default for phosphate, with unit mg/L
Sourcepub fn cal_potassium_default(&mut self)
pub fn cal_potassium_default(&mut self)
Set calibration to a sensible default for potassium, with unit mg/L
Sourcepub fn read<I2C, E>(&mut self, t: TempSource, i2c: &mut I2C) -> f32
pub fn read<I2C, E>(&mut self, t: TempSource, i2c: &mut I2C) -> f32
Take a pH reading
Sourcepub fn read_voltage<I2C, E>(&mut self, i2c: &mut I2C) -> f32
pub fn read_voltage<I2C, E>(&mut self, i2c: &mut I2C) -> f32
Useful for getting calibration data
Sourcepub fn calibrate<I2C, E>(
&mut self,
slot: CalSlot,
pH: f32,
t: TempSource,
i2c: &mut I2C,
) -> (f32, f32)
pub fn calibrate<I2C, E>( &mut self, slot: CalSlot, pH: f32, t: TempSource, i2c: &mut I2C, ) -> (f32, f32)
Calibrate by measuring voltage and temp at a given pH. Set the calibration, and return (Voltage, Temp).
pub fn calibrate_all(&mut self, pt0: CalPt, pt1: CalPt, pt2: Option<CalPt>)
pub fn reset_calibration(&mut self)
Auto Trait Implementations§
impl Freeze for PhSensor
impl RefUnwindSafe for PhSensor
impl Send for PhSensor
impl Sync for PhSensor
impl Unpin for PhSensor
impl UnwindSafe for PhSensor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more