schm1tz1 / arduino-tsic Goto Github PK
View Code? Open in Web Editor NEWArduino Library for reading digital TSIC temperature sensors (e.g. 206/305/306...)
License: GNU General Public License v3.0
Arduino Library for reading digital TSIC temperature sensors (e.g. 206/305/306...)
License: GNU General Public License v3.0
I've noticed that the function getTemperture slows down dramtically if no sensor is connected. I think this is an issue because the timeout in the function readSensor is set too high.
My explanation for the slowing would be the following (please correct me if I'm wrong ;) )
The function reads out the PIN where a TSIC should be to measure the strobe time. Therefore, it waits for the start bit, i.e. until the level goes from HIGH to LOW ("while (TSIC_HIGH)....") and then measures the strobe time as the time when the PIN is in LOW state ("while (TSIC_LOW)..."). If no sensor is connected, the level is (IMO) either LOW or HIGH and does not change its state. Which means that it will run in the timeout either in the first while loop or in the second.
Currently, the timeout is checked with "#define Cancel() if (timeout==0){return 0;}". As timeout is of uint16_t type, it will be 0 again after adding 2^16=65k times 1.
Long story short, a "#define Cancel() if (timeout>10000){return 0;}" made my program faster.
What do you think of this change in the code?
btw: here is also some code for arduino&tsic:
http://www.andeanelectronic.com/?Supporte___Arduino_con_TSic306%2CTSic506_y_TSic716
Please revert readme.md to previous version to avoid confusion.
My readme.md contained already the documentation for my fork.
So my readme.md doesn't fit to your library.
Sorry, was my fault...
PS: I just uploaded my version of the library, if you want to have a look.
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.