You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One _might_ think that reading a temperature sensor results in a temperature. Here, that's not the case. The sensor reports a relative voltage which we need to calculate using the following formula:
86
+
86
87
$$ reading \times \frac{3.3}{65535} $$
87
88
88
89
This should result from a _method_ of `Sensor` named `read_sensor_voltage` called in `main`.
@@ -92,8 +93,11 @@ This should result from a _method_ of `Sensor` named `read_sensor_voltage` calle
92
93
#### Temperatures
93
94
94
95
Now that we have the reading of the voltage of the sensor, we convert to a `Celsius` temperature using the following conversion:
96
+
95
97
$$ 27 - \frac{(voltage - 0.706)}{0.001721} $$
98
+
96
99
From there, we can calculate the temperature in Fahrenheit, which we'll use to determine relative warmth:
100
+
97
101
$$ (celsius \times \frac{9}{5}) + 32$$
98
102
99
103
The functions that do this work should be named, respectively:
0 commit comments