diff --git a/README.md b/README.md index 2047a43..3ab6860 100644 --- a/README.md +++ b/README.md @@ -36,12 +36,12 @@ Returns True if read was successful, False otherwise. Get the most recent temperature measurement. sensor.temperature() # Get temperature in default units (Centigrade) - sensor.temperature(ms5837.UNITS_Farenheit) # Get temperature in Farenheit + sensor.temperature(tsys01.UNITS_Fahrenheit) # Get temperature in Fahrenheit Valid arguments are: tsys01.UNITS_Centigrade - tsys01.UNITS_Farenheit + tsys01.UNITS_Fahrenheit tsys01.UNITS_Kelvin Returns the most recent temperature in the requested units, or temperature in degrees Centigrade if invalid units specified. Call read() to update. diff --git a/example.py b/example.py index 385a516..c8fe75f 100644 --- a/example.py +++ b/example.py @@ -12,5 +12,5 @@ if not sensor.read(): print("Error reading sensor") exit(1) - print("Temperature: %.2f C\t%.2f F") % (sensor.temperature(), sensor.temperature(tsys01.UNITS_Farenheit)) - sleep(0.2) \ No newline at end of file + print("Temperature: %.2f C\t%.2f F") % (sensor.temperature(), sensor.temperature(tsys01.UNITS_Fahrenheit)) + sleep(0.2) diff --git a/tsys01/tsys01.py b/tsys01/tsys01.py index 64cdae5..75e704b 100644 --- a/tsys01/tsys01.py +++ b/tsys01/tsys01.py @@ -7,7 +7,7 @@ # Valid units UNITS_Centigrade = 1 -UNITS_Farenheit = 2 +UNITS_Fahrenheit = 2 UNITS_Kelvin = 3 @@ -73,7 +73,7 @@ def read(self): # Temperature in requested units # default degrees C def temperature(self, conversion=UNITS_Centigrade): - if conversion == UNITS_Farenheit: + if conversion == UNITS_Fahrenheit: return (9/5) * self._temperature + 32 elif conversion == UNITS_Kelvin: return self._temperature - 273