Skip to content

Commit ce16513

Browse files
committed
Tidy up print formatting in example and added TODO for bug in main code with regards saturation detection
1 parent ddd6412 commit ce16513

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Adafruit_TSL2561/Adafruit_TSL2561.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ def calculate_lux(self):
436436
else:
437437
clip_threshold = self.TSL2561_CLIPPING_402MS
438438

439+
# TODO: Fix that exception not raised when hits saturation but returns a Lux of around 780
439440
if (self._broadband > clip_threshold) or (self._ir > clip_threshold):
440441
raise OverflowError('TSL2561 Sensor Saturated')
441442

@@ -568,6 +569,6 @@ def calculate_avg_lux(self, testavg=TSL2561_NO_OF_AVG_SAMPLES):
568569
except KeyboardInterrupt:
569570
quit()
570571
else:
571-
print("Invalid arg(s):", sys.argv)
572+
print("Invalid arg(s):", sys.argv[1])
572573
except IndexError:
573574
print(int(LightSensor.calculate_avg_lux()))

Adafruit_TSL2561/Adafruit_TSL2561_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616
except OverflowError as e:
1717
print(e)
1818
else:
19-
print('Lux value is %d', lux)
19+
print("Lux value is ", lux)

0 commit comments

Comments
 (0)