Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Linted
  • Loading branch information
evaherrada committed Apr 6, 2021
commit dd0b9e7ef772edcc746961f33fd4415a9a3a4c8d
24 changes: 12 additions & 12 deletions adafruit_bno055.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ def mode(self):
legend: x=on, -=off (see Table 3-3 in datasheet)

+------------------+-------+---------+------+----------+----------+
| Mode | Accel | Compass | Gyro | Fusion | Fusion |
| | | (Mag) | | Absolute | Relative |
| Mode | Accel | Compass | Gyro | Fusion | Fusion |
| | | (Mag) | | Absolute | Relative |
+==================+=======+=========+======+==========+==========+
| CONFIG_MODE | - | - | - | - | - |
| CONFIG_MODE | - | - | - | - | - |
+------------------+-------+---------+------+----------+----------+
| ACCONLY_MODE | X | - | - | - | - |
+------------------+-------+---------+------+----------+----------+
Expand All @@ -212,7 +212,7 @@ def mode(self):
+------------------+-------+---------+------+----------+----------+
| COMPASS_MODE | X | X | - | X | - |
+------------------+-------+---------+------+----------+----------+
| M4G_MODE | X | X | - | - | X |
| M4G_MODE | X | X | - | - | X |
+------------------+-------+---------+------+----------+----------+
| NDOF_FMC_OFF_MODE| X | X | X | X | - |
+------------------+-------+---------+------+----------+----------+
Expand Down Expand Up @@ -363,7 +363,7 @@ def magnetic(self):
"""Gives the raw magnetometer readings in microteslas.
Returns an empty tuple of length 3 when this property has been disabled by the current mode.
"""
if self.mode not in [0x00, 0X01, 0x03, 0x05, 0x08]:
if self.mode not in [0x00, 0x01, 0x03, 0x05, 0x08]:
return self._magnetic
return (None, None, None)

Expand Down Expand Up @@ -714,37 +714,37 @@ def _temperature(self):
@property
def _acceleration(self):
resp = struct.unpack("<hhh", self._read_register(0x08, 6))
return tuple([x / 100 for x in resp])
return tuple(x / 100 for x in resp)

@property
def _magnetic(self):
resp = struct.unpack("<hhh", self._read_register(0x0E, 6))
return tuple([x / 16 for x in resp])
return tuple(x / 16 for x in resp)

@property
def _gyro(self):
resp = struct.unpack("<hhh", self._read_register(0x14, 6))
return tuple([x * 0.001090830782496456 for x in resp])
return tuple(x * 0.001090830782496456 for x in resp)

@property
def _euler(self):
resp = struct.unpack("<hhh", self._read_register(0x1A, 6))
return tuple([x / 16 for x in resp])
return tuple(x / 16 for x in resp)

@property
def _quaternion(self):
resp = struct.unpack("<hhhh", self._read_register(0x20, 8))
return tuple([x / (1 << 14) for x in resp])
return tuple(x / (1 << 14) for x in resp)

@property
def _linear_acceleration(self):
resp = struct.unpack("<hhh", self._read_register(0x28, 6))
return tuple([x / 100 for x in resp])
return tuple(x / 100 for x in resp)

@property
def _gravity(self):
resp = struct.unpack("<hhh", self._read_register(0x2E, 6))
return tuple([x / 100 for x in resp])
return tuple(x / 100 for x in resp)

@property
def offsets_accelerometer(self):
Expand Down