@@ -10,7 +10,6 @@ drivers:
1010 - wsen-hids
1111 - wsen-pads
1212 - lis2mdl
13- - bq27441
1413
1514tests :
1615 - name : " Read all temperature sensors"
2120 sys.path.insert(0, '/remote/wsen-hids')
2221 sys.path.insert(0, '/remote/wsen-pads')
2322 sys.path.insert(0, '/remote/lis2mdl')
24- sys.path.insert(0, '/remote/bq27441')
2523
2624 from machine import I2C
2725 from time import sleep_ms
@@ -49,31 +47,26 @@ tests:
4947 pads = WSEN_PADS(i2c)
5048 temps['WSEN-PADS'] = pads.temperature()
5149
52- # LIS2MDL
50+ # LIS2MDL (auxiliary, offset not guaranteed by datasheet)
5351 from lis2mdl.device import LIS2MDL
5452 mag = LIS2MDL(i2c)
5553 temps['LIS2MDL'] = mag.read_temperature_c()
5654
57- # BQ27441
58- from bq27441.device import BQ27441, TempMeasureType
59- bq = BQ27441(i2c)
60- raw = bq.temperature(TempMeasureType(1))
61- temps['BQ27441'] = raw / 10.0 - 273.15
62-
6355 # Print comparison table
6456 print('--- Temperature Comparison ---')
6557 for name, t in temps.items():
66- print(' ' + name.ljust(12) + ': ' + str(round(t, 2)) + ' C')
58+ pad = ' ' * (12 - len(name))
59+ print(' ' + name + pad + ': ' + str(round(t, 2)) + ' C')
6760
68- # Check all in plausible range
69- all_ok = all(5.0 <= t <= 50.0 for t in temps.values())
61+ # Check dedicated thermometers in plausible range
62+ dedicated = [temps['HTS221'], temps['WSEN-HIDS'], temps['WSEN-PADS']]
63+ all_ok = all(5.0 <= t <= 50.0 for t in dedicated)
7064
7165 # Check spread between dedicated thermometers
72- dedicated = [temps['HTS221'], temps['WSEN-HIDS']]
7366 spread = max(dedicated) - min(dedicated)
74- print(' Spread (HTS221 vs WSEN-HIDS ): ' + str(round(spread, 2)) + ' C')
67+ print(' Spread (dedicated ): ' + str(round(spread, 2)) + ' C')
7568
76- result = all_ok and spread < 3 .0
69+ result = all_ok and spread < 8 .0
7770 expect_true : true
7871 mode : [hardware]
7972
0 commit comments