Skip to content

Commit 110cca4

Browse files
committed
minor cleanup
1 parent d7ad580 commit 110cca4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*.mpy
22
.idea
3+
.vscode
34
__pycache__
45
_build
56
*.pyc
@@ -9,4 +10,4 @@ bundles
910
*.DS_Store
1011
.eggs
1112
dist
12-
**/*.egg-info
13+
**/*.egg-info

adafruit_msa301.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,16 @@ def __init__(self, i2c_bus):
190190
if self._part_id != 0x13:
191191
raise AttributeError("Cannot find a MSA301")
192192

193-
self._enable_all_axes()
193+
194+
self._disable_x = self._disable_y = self._disable_z = False
194195
self.power_mode = Mode.NORMAL
195196
self.data_rate = DataRate.RATE_500_HZ
196197
self.bandwidth = BandWidth.WIDTH_250_HZ
197198
self.range = Range.RANGE_4_G
198199
self.resolution = Resolution.RESOLUTION_14_BIT
199200

200201

202+
201203
_disable_x = RWBit(_MSA301_REG_ODR, 7)
202204
_disable_y = RWBit(_MSA301_REG_ODR, 6)
203205
_disable_z = RWBit(_MSA301_REG_ODR, 5)
@@ -246,6 +248,3 @@ def acceleration(self):
246248
z_acc = ((z>>2) / scale) * _STANDARD_GRAVITY
247249

248250
return (x_acc, y_acc, z_acc)
249-
250-
def _enable_all_axes(self):
251-
self._disable_x = self._disable_y = self._disable_z = False

0 commit comments

Comments
 (0)