Skip to content

Commit 938c4e8

Browse files
committed
Revert "Fixing pylint issues"
This reverts commit c0bd6b8.
1 parent c0bd6b8 commit 938c4e8

File tree

5 files changed

+24
-62
lines changed

5 files changed

+24
-62
lines changed

adafruit_bno055.py

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def use_external_crystal(self, value):
228228
def temperature(self):
229229
"""Measures the temperature of the chip in degrees Celsius."""
230230
return self._temperature
231-
231+
232232
@temperature.setter
233233
def temperature(self):
234234
self._temperature = _ReadOnlyUnaryStruct(0x34, 'b')
@@ -238,8 +238,9 @@ def acceleration(self):
238238
"""Gives the raw accelerometer readings, in m/s."""
239239
if self.mode not in [0, 2, 3, 6]:
240240
return self._acceleration
241-
return (None, None, None)
242-
241+
else:
242+
return (None, None, None)
243+
243244
@acceleration.setter
244245
def acceleration(self):
245246
self._acceleration = _ScaledReadOnlyStruct(0x08, '<hhh', 1/100)
@@ -250,7 +251,9 @@ def magnetic(self):
250251
"""Gives the raw magnetometer readings in microteslas."""
251252
if self.mode not in [0, 3, 5, 8]:
252253
return self._magnetic
253-
return (None, None, None)
254+
255+
else:
256+
return (None, None, None)
254257

255258
@magnetic.setter
256259
def magnetic(self):
@@ -262,7 +265,9 @@ def gyro(self):
262265
"""Gives the raw gyroscope reading in radians per second."""
263266
if self.mode not in [0, 1, 2, 4, 9, 10]:
264267
return self._gyro
265-
return (None, None, None)
268+
269+
else:
270+
return (None, None, None)
266271

267272
@gyro.setter
268273
def gyro(self):
@@ -273,8 +278,10 @@ def gyro(self):
273278
def euler(self):
274279
"""Gives the calculated orientation angles, in degrees."""
275280
if self.mode in [9, 11, 12]:
281+
276282
return self._euler
277-
return (None, None, None)
283+
else:
284+
return (None, None, None)
278285

279286
@euler.setter
280287
def euler(self):
@@ -286,19 +293,22 @@ def quaternion(self):
286293
"""Gives the calculated orientation as a quaternion."""
287294
if self.mode in [9, 11, 12]:
288295
return self._quaternion
289-
return (None, None, None, None)
296+
else:
297+
return (None, None, None, None)
290298

291299
@quaternion.setter
292300
def quaternion(self):
293-
self._quaternion = _ScaledReadOnlyStruct(0x20, '<hhhh', 1/(1<<14))
301+
self._quaternion = _ScaledReadOnlyStruct(0x20, '<hhhh', 1/(1<<14))
294302

295303

296304
@property
297305
def linear_acceleration(self):
298306
"""Returns the linear acceleration, without gravity, in m/s."""
299307
if self.mode in [9, 11, 12]:
300308
return self._linear_acceleration
301-
return (None, None, None)
309+
310+
else:
311+
return (None, None, None)
302312

303313
@linear_acceleration.setter
304314
def linear_acceleration(self):
@@ -310,8 +320,10 @@ def gravity(self):
310320
"""Returns the gravity vector, without acceleration in m/s."""
311321
if self.mode in [9, 11, 12]:
312322
return self._gravity
313-
return (None, None, None)
323+
324+
else:
325+
return (None, None, None)
314326

315327
@gravity.setter
316328
def gravity(self):
317-
self._gravity = _ScaledReadOnlyStruct(0x2e, '<hhh', 1/100)
329+
self._gravity = _ScaledReadOnlyStruct(0x2e, '<hhh', 1/100)

examples/bno055_simpletest.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@
66
i2c = busio.I2C(board.SCL, board.SDA)
77
sensor = adafruit_bno055.BNO055(i2c)
88

9-
a = [adafruit_bno055.ACCONLY_MODE, adafruit_bno055.MAGONLY_MODE, adafruit_bno055.GYRONLY_MODE, adafruit_bno055.ACCMAG_MODE, adafruit_bno055.ACCGYRO_MODE, adafruit_bno055.MAGGYRO_MODE, adafruit_bno055.AMG_MODE, adafruit_bno055.IMUPLUS_MODE, adafruit_bno055.COMPASS_MODE, adafruit_bno055.M4G_MODE, adafruit_bno055.NDOF_FMC_OFF_MODE, adafruit_bno055.NDOF_MODE]
10-
for i in a:
11-
print(i)
12-
#sensor.mode = i
13-
sensor.mode = adafruit_bno055.AMG_MODE
9+
while True:
1410
print('Temperature: {} degrees C'.format(sensor.temperature))
1511
print('Accelerometer (m/s^2): {}'.format(sensor.acceleration))
1612
print('Magnetometer (microteslas): {}'.format(sensor.magnetic))

examples/compasstest.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

examples/modetest.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

examples/test.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)