Skip to content

Commit 58d7cb4

Browse files
committed
fixing formatted strings
1 parent 746b19c commit 58d7cb4

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

examples/ism330dhct_simpletest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
sensor = ISM330DHCT(i2c)
99

1010
while True:
11-
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2"%(sensor.acceleration))
12-
print("Gyro X:%.2f, Y: %.2f, Z: %.2f degrees/s"%(sensor.gyro))
11+
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2" % (sensor.acceleration))
12+
print("Gyro X:%.2f, Y: %.2f, Z: %.2f degrees/s" % (sensor.gyro))
1313
print("")
1414
time.sleep(0.5)

examples/lsm6ds33_simpletest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
sensor = LSM6DS33(i2c)
99

1010
while True:
11-
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2"%(sensor.acceleration))
12-
print("Gyro X:%.2f, Y: %.2f, Z: %.2f degrees/s"%(sensor.gyro))
11+
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2" % (sensor.acceleration))
12+
print("Gyro X:%.2f, Y: %.2f, Z: %.2f degrees/s" % (sensor.gyro))
1313
print("")
1414
time.sleep(0.5)

examples/lsm6ds_full_test.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
#sensor = ISM330DHCT(i2c)
1212

1313
sensor.accelerometer_range = AccelRange.RANGE_8G
14-
print("Accelerometer range set to: %d G"%AccelRange.string[sensor.accelerometer_range])
14+
print("Accelerometer range set to: %d G" % AccelRange.string[sensor.accelerometer_range])
1515

1616
sensor.gyro_range = GyroRange.RANGE_2000_DPS
17-
print("Gyro range set to: %d DPS"%GyroRange.string[sensor.gyro_range])
17+
print("Gyro range set to: %d DPS" % GyroRange.string[sensor.gyro_range])
1818

1919
sensor.accelerometer_data_rate = Rate.RATE_1_66K_HZ
2020
#sensor.accelerometer_data_rate = Rate.RATE_12_5_HZ
21-
print("Accelerometer rate set to: %d HZ"%Rate.string[sensor.accelerometer_data_rate])
21+
print("Accelerometer rate set to: %d HZ" % Rate.string[sensor.accelerometer_data_rate])
2222

2323
sensor.gyro_data_rate = Rate.RATE_1_66K_HZ
24-
print("Gyro rate set to: %d HZ"%Rate.string[sensor.gyro_data_rate])
24+
print("Gyro rate set to: %d HZ" % Rate.string[sensor.gyro_data_rate])
2525

2626
while True:
27-
print("Accel X:%.2f Y:%.2f Z:%.2f ms^2 Gyro X:%.2f Y:%.2f Z:%.2f degrees/s"%
27+
print("Accel X:%.2f Y:%.2f Z:%.2f ms^2 Gyro X:%.2f Y:%.2f Z:%.2f degrees/s" %
2828
(sensor.acceleration+sensor.gyro))
2929
time.sleep(0.05)

examples/lsm6ds_rate_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,17 @@
1313
sensor.accelerometer_data_rate = Rate.RATE_12_5_HZ
1414
sensor.gyro_data_rate = Rate.RATE_12_5_HZ
1515
for i in range(100):
16-
print("(%.2f, %.2f, %.2f, %.2f, %.2f, %.2f"%(sensor.acceleration+sensor.gyro))
16+
print("(%.2f, %.2f, %.2f, %.2f, %.2f, %.2f" % (sensor.acceleration+sensor.gyro))
1717
print()
1818

1919
sensor.accelerometer_data_rate = Rate.RATE_52_HZ
2020
sensor.gyro_data_rate = Rate.RATE_52_HZ
2121
for i in range(100):
22-
print("(%.2f, %.2f, %.2f, %.2f, %.2f, %.2f"%(sensor.acceleration+sensor.gyro))
22+
print("(%.2f, %.2f, %.2f, %.2f, %.2f, %.2f" % (sensor.acceleration+sensor.gyro))
2323
print()
2424

2525
sensor.accelerometer_data_rate = Rate.RATE_416_HZ
2626
sensor.gyro_data_rate = Rate.RATE_416_HZ
2727
for i in range(100):
28-
print("(%.2f, %.2f, %.2f, %.2f, %.2f, %.2f"%(sensor.acceleration+sensor.gyro))
28+
print("(%.2f, %.2f, %.2f, %.2f, %.2f, %.2f" % (sensor.acceleration+sensor.gyro))
2929
print()

examples/lsm6dsox_simpletest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
sensor = LSM6DSOX(i2c)
99

1010
while True:
11-
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2"%(sensor.acceleration))
12-
print("Gyro X:%.2f, Y: %.2f, Z: %.2f degrees/s"%(sensor.gyro))
11+
print("Acceleration: X:%.2f, Y: %.2f, Z: %.2f m/s^2" % (sensor.acceleration))
12+
print("Gyro X:%.2f, Y: %.2f, Z: %.2f degrees/s" % (sensor.gyro))
1313
print("")
1414
time.sleep(0.5)

0 commit comments

Comments
 (0)