We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d87a13 commit f4a4adaCopy full SHA for f4a4ada
1 file changed
src/Sensor.py
@@ -8,8 +8,13 @@ def __init__(self):
8
self.thermo = ADC(4)
9
10
def read_sensor_voltage(self):
11
- adc_value = self.thermo.read_u16()
12
- voltage = adc_value * (3.3 / 65535)
13
- return voltage
+ """Read the 16-bit ADC value from the temperature sensor and convert it to volts.
14
15
-
+ This method calls self.thermo.read_u16() to obtain a 16-bit ADC reading
+ (0–65535) and converts it to a voltage using a 3.3V reference.
+
16
+ Returns:
17
+ float: The measured voltage in volts.
18
+ """
19
+ # TODO - Implement the method to read the ADC value and convert it to voltage
20
0 commit comments