EnviroDIY / Arduino-SDI-12

An Arduino library for SDI-12 communication with a wide variety of environmental sensors. This library provides a general software solution, without requiring any additional hardware.
https://github.com/EnviroDIY/Arduino-SDI-12/wiki
BSD 3-Clause "New" or "Revised" License
164 stars 100 forks source link

Inherit from Arduino Stream Class #6

Closed Kevin-M-Smith closed 8 years ago

Kevin-M-Smith commented 10 years ago

By inheriting from the Arduino Stream class the SDI-12 library now has access to the parseFloat() and parseInt() functions. This allows the Arduino to more easily manipulate incoming data. The compiled size of the library is not significantly changed. There are no known cons or downsides to this change.

An additional example has been added to demonstrate the functionality.

Please review the Stream branch to see if it is ready to commit.

aufdenkampe commented 10 years ago

@Kevin-M-Smith, thanks for developing these new parsing capabilities. This is a big improvement to the Library! @steve-2, if you are OK with these changes, please merge this pull request.

s-hicks2 commented 10 years ago

I think Kevin wanted to update the example parsing sketch and also check the compatibility with different IDE versions before merging.

Steve

Anthony Aufdenkampe wrote:

@Kevin-M-Smith https://github.com/Kevin-M-Smith, thanks for developing these new parsing capabilities. This is a big improvement to the Library! @steve-2 https://github.com/steve-2, if you are OK with these changes, please merge this pull request.

— Reply to this email directly or view it on GitHub https://github.com/StroudCenter/Arduino-SDI-12/pull/6#issuecomment-38968922.


Steve Hicks Research Engineer Stroud Water Research Center 970 Spencer Road, Avondale, PA 19311 Tel: 610-268-2153 ext. 267 Fax 610-268-0490 shicks@stroudcenter.org

aufdenkampe commented 10 years ago

Kevin, anything else to update here?

On Fri, Mar 28, 2014 at 5:24 PM, Steve Hicks notifications@github.comwrote:

I think Kevin wanted to update the example parsing sketch and also check the compatibility with different IDE versions before merging.

Steve

Anthony Aufdenkampe wrote:

@Kevin-M-Smith https://github.com/Kevin-M-Smith, thanks for developing these new parsing capabilities. This is a big improvement to the Library! @steve-2 https://github.com/steve-2, if you are OK with these changes, please merge this pull request.

Reply to this email directly or view it on GitHub < https://github.com/StroudCenter/Arduino-SDI-12/pull/6#issuecomment-38968922 .


Steve Hicks Research Engineer Stroud Water Research Center 970 Spencer Road, Avondale, PA 19311 Tel: 610-268-2153 ext. 267 Fax 610-268-0490 shicks@stroudcenter.org

Reply to this email directly or view it on GitHubhttps://github.com/StroudCenter/Arduino-SDI-12/pull/6#issuecomment-38969647 .


Anthony K. Aufdenkampe, Ph.D. Associate Research Scientist - Isotope & Organic Geochemistry Stroud Water Research Center 970 Spencer Road, Avondale, PA 19311 Tel. 610-268-2153 ext. 263; Fax 610-268-0490 Mobile 484-748-0252 http://www.stroudcenter.org/about/aufdenkampe.shtm

Kevin-M-Smith commented 10 years ago

@steve-2 Regarding the update to the parsing example: do you just mean adding a recommendation to use the latest Arduino IDE in the comments?

Kevin-M-Smith commented 10 years ago

@steve-2 I'm going to echo @aufdenkampe on the point that if you feel the Stream class is ready, we should merge this pull request. I will then add the changes you mentioned as a separate pull request so it is clear what is changing.

s-hicks2 commented 10 years ago

I think we should update the e_simple_parsing example for a couple things. One was that I changed all of the parseInt commands to parseFloat. Most of our newer sensors have all floats in the SDI-12 string, and on other sensors even if parseFloat encounters an integer, it still parses it properly from the string.

The other, more important, thing is that I had to remove some of the timing code in order for the sketch to work with the latest batch of CTD sensors. Instead of waiting to hear back from the sensor about how long the measurement should take, I just capture everything coming from the sensor, throw out the first parsed "junk" integer, and then the next 3 values are the measurements I want. It was the only way I could get the string properly captured by the parsing routine.

Kevin-M-Smith commented 10 years ago

Could you send the changes to the example as a gist?