Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing some typos #14

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
4 changes: 2 additions & 2 deletions example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
print("Temperature: %.2f C\t%.2f F") % (sensor.temperature(), sensor.temperature(tsys01.UNITS_Fahrenheit))
sleep(0.2)
4 changes: 2 additions & 2 deletions tsys01/tsys01.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# Valid units
UNITS_Centigrade = 1
UNITS_Farenheit = 2
UNITS_Fahrenheit = 2
UNITS_Kelvin = 3


Expand Down Expand Up @@ -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
Expand Down