Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
e5f06559
Commit
e5f06559
authored
Oct 31, 2016
by
ernitron
Committed by
Damien George
Nov 02, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
esp8266/modules: Fix negative temperature in ds18x20 driver.
parent
10bde693
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
esp8266/modules/ds18x20.py
esp8266/modules/ds18x20.py
+4
-1
No files found.
esp8266/modules/ds18x20.py
View file @
e5f06559
...
...
@@ -43,4 +43,7 @@ class DS18X20:
t
=
buf
[
0
]
>>
1
return
t
-
0.25
+
(
buf
[
7
]
-
buf
[
6
])
/
buf
[
7
]
else
:
return
(
buf
[
1
]
<<
8
|
buf
[
0
])
/
16
t
=
buf
[
1
]
<<
8
|
buf
[
0
]
if
t
&
0x8000
:
# sign bit set
t
=
-
((
t
^
0xffff
)
+
1
)
return
t
/
16
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment