Skip to content

Commit f4a4ada

Browse files
authored
Update Sensor.py
1 parent 2d87a13 commit f4a4ada

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/Sensor.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ def __init__(self):
88
self.thermo = ADC(4)
99

1010
def read_sensor_voltage(self):
11-
adc_value = self.thermo.read_u16()
12-
voltage = adc_value * (3.3 / 65535)
13-
return voltage
11+
"""Read the 16-bit ADC value from the temperature sensor and convert it to volts.
1412
15-
13+
This method calls self.thermo.read_u16() to obtain a 16-bit ADC reading
14+
(0–65535) and converts it to a voltage using a 3.3V reference.
15+
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

Comments
 (0)