55from steami_config import SteamiConfig
66
77
8- def populate_all_config (config ):
9- """Fill all configuration fields with example values."""
10-
11- # --------------------------------------------------
12- # Board info
13- # --------------------------------------------------
14- config .board_revision = 3
15- config .board_name = "STeaMi Demo Board"
16-
17- # --------------------------------------------------
18- # Temperature calibration (example values)
19- # --------------------------------------------------
20- config .set_temperature_calibration ("hts221" , gain = 1.01 , offset = - 0.5 )
21- config .set_temperature_calibration ("lis2mdl" , gain = 0.99 , offset = + 0.2 )
22- config .set_temperature_calibration ("ism330dl" , gain = 1.00 , offset = 0.0 )
23- config .set_temperature_calibration ("wsen_hids" , gain = 1.02 , offset = - 0.3 )
24- config .set_temperature_calibration ("wsen_pads" , gain = 0.98 , offset = + 0.4 )
25-
26- # --------------------------------------------------
27- # Magnetometer calibration
28- # --------------------------------------------------
29- config .set_magnetometer_calibration (
30- hard_iron_x = + 10.5 ,
31- hard_iron_y = - 3.2 ,
32- hard_iron_z = + 1.7 ,
33- soft_iron_x = 1.02 ,
34- soft_iron_y = 0.97 ,
35- soft_iron_z = 1.05 ,
36- )
37-
38- # --------------------------------------------------
39- # Accelerometer calibration
40- # --------------------------------------------------
41- config .set_accelerometer_calibration (
42- ox = + 0.01 ,
43- oy = - 0.02 ,
44- oz = + 0.03 ,
45- )
46-
47- # --------------------------------------------------
48- # Boot counter
49- # --------------------------------------------------
50- config .set_boot_count (42 )
51-
52- # Save everything
53- config .save ()
54-
55-
568def print_section (title ):
579 print (title )
5810 print ("-" * len (title ))
@@ -61,13 +13,12 @@ def print_section(title):
6113def print_kv (label , value ):
6214 print ("{:<16} {}" .format (label + ":" , value ))
6315
16+
6417i2c = I2C (1 )
6518bridge = DaplinkBridge (i2c )
6619config = SteamiConfig (bridge )
6720config .load ()
6821
69- # populate_all_config(config)
70-
7122print ("=== STeaMi Configuration ===" )
7223print ()
7324
0 commit comments