Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

omnomnomsies

Member Since 07 Nov 2011
Offline Last Active Dec 08 2011 05:09 PM
-----

#20669 SparkFun TMP102 Digital Temperature Sensor

Posted by omnomnomsies on 15 November 2011 - 09:32 PM

Here is a class that can be used to get the Netduino talking with the TMP102 breakout from SparkFun (<$6).

http://www.sparkfun.com/products/9418

I imagine that this approach could be modified to use the I2CBus as well... mileage may vary. Before I forget - many thanks to all the other posters of I2C topics. Your knowledge and experience is very helpful!

Cheers,

Rick Winscot
www.quilix.com



For anyone who stumbles on this as I did and wonders what happened to the precision of the temps you can get the decimals by reading the 2nd byte (buffer[1]) and then bit shifting it over 4 times (>> 4) - that gives you a value that you multiply by .0625 for the Celsius information after the decimal point.

It was also annoying to find that String.Format doesn't exist and that Math.Round doesn't work as expected either. I used ToString("") with a format specifier depending on how many places you want.

Hopefully that will save someone out there some time.


home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.