Skip to content

Commit

Permalink
src: lib: leak: Add read_leak method
Browse files Browse the repository at this point in the history
  • Loading branch information
RaulTrombin committed Mar 1, 2024
1 parent 8cf3a9a commit 0bcbd06
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,18 @@ fn read_gyro() -> AxisData {
with_navigator!().read_gyro().into()
}

#[cpy_fn]
#[comment_c = "Reads the state of leak detector pin from Navigator."]
#[comment_py = "Reads the state of leak detector pin from Navigator.\n\n
Returns:\n
bool: The current state. `True` -> Leak detection, `False` -> No leak.\n
Examples:\n
>>> import bluerobotics_navigator as navigator\n
>>> leak_detector = navigator.read_leak()"]
fn read_leak() -> bool {
with_navigator!().read_leak()
}

#[cpy_fn]
#[comment_c = "Enables or disables the PWM chip (PCA9685), using the firmware and OE_pin."]
#[comment_py = "Enables or disables the PWM chip (PCA9685), using the firmware and OE_pin.\n
Expand Down Expand Up @@ -503,6 +515,7 @@ cpy_module!(
read_adc,
read_pressure,
read_temp,
read_leak,
read_mag,
read_accel,
read_gyro,
Expand Down

0 comments on commit 0bcbd06

Please sign in to comment.