From 3101e5625216a79862067718359df21f81995b6a Mon Sep 17 00:00:00 2001 From: HerrNamenlos123 Date: Fri, 19 Mar 2021 15:16:16 +0100 Subject: [PATCH] Lowered minimal battery voltage and added ir sensor example --- compLib/Battery.py | 2 +- docs/source/lib/IRSensor.rst | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/compLib/Battery.py b/compLib/Battery.py index 2fc0eb1..38f43a8 100644 --- a/compLib/Battery.py +++ b/compLib/Battery.py @@ -4,7 +4,7 @@ from compLib.LogstashLogging import Logging BATTERY_CHANNEL = 2 BATTERY_COUNT = 2 BATTERY_MULTIPLIER = 3 -BATTERY_MIN_VOLTAGE = 3.6 +BATTERY_MIN_VOLTAGE = 3.4 BATTERY_MAX_VOLTAGE = 4.2 adc = ADC() diff --git a/docs/source/lib/IRSensor.rst b/docs/source/lib/IRSensor.rst index 72e60f9..26332b9 100644 --- a/docs/source/lib/IRSensor.rst +++ b/docs/source/lib/IRSensor.rst @@ -4,4 +4,19 @@ Infrared Sensor **************** .. autoclass:: compLib.IRSensor.IRSensor - :members: \ No newline at end of file + :members: + +Examples +========= + +Testing analog sensors +------------------------- + +.. code-block:: python + + from compLib import IRSensor + + ir = IRSensor.IRSensor() + + while True: + print ("left: {} middle: {} right: {}".format(ir.bottom_left_analog(), ir.bottom_middle_analog(), ir.bottom_right_analog())) \ No newline at end of file