Skip to content

Commit

Permalink
bank selection changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jposada202020 committed Aug 11, 2023
1 parent 3da06b0 commit 194ecb7
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions micropython_icm20948/icm20948.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ def acceleration(self) -> Tuple[float, float, float]:
:return: Acceleration Values
"""
raw_measurement = self._raw_accel_data
# sleep(0.005)
x = (
raw_measurement[0]
/ acc_range_sensitivity[self._memory_accel_range]
Expand All @@ -438,7 +437,6 @@ def gyro(self) -> Tuple[float, float, float]:
:return: Angular velocity Values
"""
raw_measurement = self._raw_gyro_data
# sleep(0.005)
x = (
raw_measurement[0]
/ gyro_full_scale_sensitivity[self._memory_gyro_fs]
Expand Down Expand Up @@ -525,10 +523,8 @@ def gyro_full_scale(self, value: int) -> None:
raise ValueError("Value must be a valid gyro_full_scale setting")
self._user_bank = 2
self._gyro_full_scale = value
# sleep(0.005)
self._memory_gyro_fs = value
self._user_bank = 0
# sleep(0.1)

@property
def temperature(self) -> float:
Expand Down Expand Up @@ -613,7 +609,6 @@ def gyro_data_rate_divisor(self) -> int:

self._user_bank = 2
raw_rate_divisor = self._gyro_rate_divisor
# sleep(0.005)
self._user_bank = 0
return raw_rate_divisor

Expand All @@ -622,10 +617,8 @@ def gyro_data_rate_divisor(self, value: int) -> None:
if value not in gyro_rate_divisor_values:
raise ValueError("Value must be a valid gyro data rate divisor setting")
self._user_bank = 2
# sleep(0.005)
self._gyro_rate_divisor = value
self._user_bank = 0
# sleep(0.005)

@property
def acc_data_rate(self):
Expand Down Expand Up @@ -692,7 +685,6 @@ def acc_data_rate_divisor(self) -> int:

self._user_bank = 2
raw_rate_divisor = self._acc_rate_divisor
# sleep(0.005)
self._user_bank = 0
return raw_rate_divisor

Expand All @@ -703,10 +695,8 @@ def acc_data_rate_divisor(self, value: int) -> None:
"Value must be a valid acceleration data rate divisor setting"
)
self._user_bank = 2
# sleep(0.005)
self._acc_rate_divisor = value
self._user_bank = 0
# sleep(0.005)

@property
def acc_dlpf_cutoff(self) -> int:
Expand Down Expand Up @@ -745,9 +735,7 @@ def acc_dlpf_cutoff(self) -> int:
"FREQ_473",
)
self._user_bank = 2
# sleep(0.005)
raw_value = self._acc_dplcfg
print(raw_value)
self._user_bank = 0
return values[raw_value - 1]

Expand All @@ -756,27 +744,22 @@ def acc_dlpf_cutoff(self, value: int) -> None:
if value not in acc_filter_values:
raise ValueError("Value must be a valid dlpf setting")
self._user_bank = 2
# sleep(0.005)
self._acc_dplcfg = value
self._user_bank = 0
# sleep(0.005)

@property
def acc_filter_choice(self) -> int:
"""Enables accelerometer DLPF"""
self._user_bank = 2
# sleep(0.005)
raw_value = self._acc_choice
self._user_bank = 0
return raw_value

@acc_filter_choice.setter
def acc_filter_choice(self, value: int) -> None:
self._user_bank = 2
# sleep(0.005)
self._acc_choice = value
self._user_bank = 0
# sleep(0.05)

@property
def gyro_dlpf_cutoff(self) -> int:
Expand Down Expand Up @@ -818,7 +801,6 @@ def gyro_dlpf_cutoff(self) -> int:
"G_FREQ_361_4",
)
self._user_bank = 2
# sleep(0.005)
raw_value = self._gyro_dplcfg
self._user_bank = 0
return values[raw_value]
Expand All @@ -828,24 +810,19 @@ def gyro_dlpf_cutoff(self, value: int) -> None:
if value not in gyro_filter_values:
raise ValueError("Value must be a valid dlpf setting")
self._user_bank = 2
# sleep(0.005)
self._gyro_dplcfg = value
self._user_bank = 0
# sleep(0.005)

@property
def gyro_filter_choice(self) -> int:
"""Enables gyro DLPF"""
self._user_bank = 2
# sleep(0.005)
raw_value = self._gyro_choice
self._user_bank = 0
return raw_value

@gyro_filter_choice.setter
def gyro_filter_choice(self, value: int) -> None:
self._user_bank = 2
# sleep(0.005)
self._gyro_choice = value
self._user_bank = 0
# sleep(0.05)

0 comments on commit 194ecb7

Please sign in to comment.