Add more logging and exception
This commit is contained in:
parent
cb10bb3a4d
commit
ce1c82a192
8 changed files with 56 additions and 19 deletions
|
@ -1,5 +1,7 @@
|
|||
import smbus
|
||||
|
||||
from compLib.LogstashLogging import Logging
|
||||
|
||||
SINGLE_ENDED = 0x84
|
||||
ADDRESS = 0x48
|
||||
|
||||
|
@ -32,4 +34,5 @@ class ADC:
|
|||
voltage = value1 / 255.0 * 3.3 # calculate the voltage value
|
||||
voltage = round(voltage, 2)
|
||||
|
||||
Logging.get_logger().debug(f"ADC.read {channel} = {voltage}")
|
||||
return voltage
|
||||
|
|
Reference in a new issue