@@ -4,16 +4,24 @@ name: "Temperature comparison (all sensors)"
44i2c :
55 id : 1
66
7+ # List of drivers needed — triggers mounting lib/ via mpremote
8+ drivers :
9+ - hts221
10+ - wsen-hids
11+ - wsen-pads
12+ - lis2mdl
13+ - bq27441
14+
715tests :
816 - name : " Read all temperature sensors"
917 action : hardware_script
1018 script : |
1119 import sys
12- sys.path.insert(0, '/flash/lib /hts221')
13- sys.path.insert(0, '/flash/lib /wsen-hids')
14- sys.path.insert(0, '/flash/lib /wsen-pads')
15- sys.path.insert(0, '/flash/lib /lis2mdl')
16- sys.path.insert(0, '/flash/lib /bq27441')
20+ sys.path.insert(0, '/remote /hts221')
21+ sys.path.insert(0, '/remote /wsen-hids')
22+ sys.path.insert(0, '/remote /wsen-pads')
23+ sys.path.insert(0, '/remote /lis2mdl')
24+ sys.path.insert(0, '/remote /bq27441')
1725
1826 from machine import I2C
1927 from time import sleep_ms
@@ -55,15 +63,15 @@ tests:
5563 # Print comparison table
5664 print('--- Temperature Comparison ---')
5765 for name, t in temps.items():
58- print(f ' { name:12s}: {t:6.2f} C')
66+ print(' ' + name.ljust(12) + ': ' + str(round(t, 2)) + ' C')
5967
6068 # Check all in plausible range
6169 all_ok = all(5.0 <= t <= 50.0 for t in temps.values())
6270
6371 # Check spread between dedicated thermometers
6472 dedicated = [temps['HTS221'], temps['WSEN-HIDS']]
6573 spread = max(dedicated) - min(dedicated)
66- print(f ' Spread (HTS221 vs WSEN-HIDS): { spread:.2f} C')
74+ print(' Spread (HTS221 vs WSEN-HIDS): ' + str(round( spread, 2)) + ' C')
6775
6876 result = all_ok and spread < 3.0
6977 expect_true : true
7381 action : hardware_script
7482 script : |
7583 import sys
76- sys.path.insert(0, '/flash/lib /hts221')
77- sys.path.insert(0, '/flash/lib /wsen-pads')
84+ sys.path.insert(0, '/remote /hts221')
85+ sys.path.insert(0, '/remote /wsen-pads')
7886
7987 from machine import I2C
8088 from time import sleep_ms
@@ -94,7 +102,7 @@ tests:
94102 t_pads = pads.temperature()
95103
96104 spread = abs(t_hts - t_pads)
97- print(f ' HTS221: { t_hts:.2f} C | WSEN-PADS: { t_pads:.2f} C | Spread: { spread:.2f} C')
105+ print(' HTS221: ' + str(round( t_hts, 2)) + ' C | WSEN-PADS: ' + str(round( t_pads, 2)) + ' C | Spread: ' + str(round( spread, 2)) + ' C')
98106 result = spread < 5.0
99107 expect_true : true
100108 mode : [hardware]
0 commit comments