Skip to content

Commit

Permalink
seeing where new() is failing part 4
Browse files Browse the repository at this point in the history
  • Loading branch information
Aux1r committed Nov 16, 2024
1 parent 5173bbd commit 99cc6d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/sensors/src/tof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl<'a, T: HypedI2c> TimeOfFlight<'a, T> {
pub fn new(i2c: &'a mut T, device_address: ToFAddresses) -> Result<Self, ToFError> {
// SR03 Settings as seen in Application Sheet
let device_address = device_address as u8;
for i in 0..20 {
for i in 0..21 {
// writing to private registers
if let Err(e) = i2c.write_byte_to_register(
device_address,
Expand All @@ -32,7 +32,7 @@ impl<'a, T: HypedI2c> TimeOfFlight<'a, T> {
panic!("Error writing private registers u8s");
}
}
for i in 0..10 {
for i in 0..11 {
// writing to private registers
if let Err(e) = i2c.write_byte_to_register_16(
device_address,
Expand Down

0 comments on commit 99cc6d6

Please sign in to comment.