yryz / ds18b20 Goto Github PK
View Code? Open in Web Editor NEWGolang get temperature from ds18b20 sensor connected to a Raspberry PI (GPIO w1 pin).
License: Apache License 2.0
Golang get temperature from ds18b20 sensor connected to a Raspberry PI (GPIO w1 pin).
License: Apache License 2.0
With all due respect, while I agree (FWIW) with the code in case '0', I question case 'f'.
To try to help, the 2 hex strings (data) I get back from 2 DSs are:
dd ff 4b 46 7f ff 03 10 25 : crc=25 YES
16 00 4b 46 7f ff 0a 10 a5 : crc=a5 YES
The temp is hovering around 0C and have used several DSs, all of which provide reasonably accurate results once the temps rise above about .5 thru 1.5C (w/in variances and compared against other HTU21D and AM2315 probes, as well as WeatherUnderground).
Summary:
This library does not validate that a correct temperature was obtained. Note this is only to validate that the 1Wire communication was successful; the DS18b20 sensor does not have self-test.
Observed behavior:
The first line of the w1 "file" is a CRC validation of the temperature value.
At this moment, the yryz/ds18b20 library does not validate that the CRC is valid before returning a temperature reading.
Desired behavior:
Expect the CRC tag to be present and "YES" immediately after.
Should this condition fail, return an error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.