Pedro

Member Since: February 16, 2009

Country: United States

  • Product SEN-09418 | about 4 years ago

    Sorry about all the runaround. It is not possible to post the code here. I posted it at this sparkfun board:
    AVR Atmel - Code
    I hope it helps

  • Product SEN-09418 | about 4 years ago

    The #include should read: “lt"wire.h"gt”. I’ll send the code to sparkfun and may be the’ll post it as one of the documents. There may be other missing lines or characters.

  • Product SEN-09418 | about 4 years ago

    Donzi,
    I apologize. The system is not copying the characters correctly, and there is one line missing from the code. I tried to post the correct two lines, previewed it (it was ok), but when I posted it, the same thing happened. Let me try to explain those two lines in words. below, substitute ltlt by two “less than” characters together (shift left operator), and “gtgt: by two "greater than” characters, also together (shift right) operator. In the second line, there is an “or equal” operator. Let’s see if this helps you. If it doesn’t you may want to open a temporary email account and I’ll send you the code. Here are the two lines:
    val = ((msb) “ltlt” 4); / MSB /
    val “or”= (lsb “gtgt” 4); / LSB /
    If anybody has an idea of why this is happening, I’d appreciate any comments.

  • Product SEN-09418 | about 4 years ago

    Donzi:
    Sorry. The copy command missed the two in the line that follows. The line that follows is also missing. I am wondering if those characters are “non printable” on this page. The correct code is this one:
    val = ((msb) 4); / LSB /

  • Product SEN-09418 | about 4 years ago

    @day1ok:
    I have an Arduino duemilanove, and have the tmp102 working. I connected V+ to the 3.3v pin on the Arduino board. Ground and Add0 to ground. SCL to analog pin 5, and sda to analog pin 4. The Alt connection is not needed. Here is my code, to read the sensor and print it through the serial port. I hope it helps.
    @futzle: I borrowed your snippets of code. They, and the rest of your comments helped a lot. Thanks!

    include

    int i;
    byte res;
    byte msb;
    byte lsb;
    int val;
    void setup()
    {
    Serial.begin(9600);
    Wire.begin();
    i = 0;
    }
    void loop()
    {
    res = Wire.requestFrom(72,2);
    if (res == 2) {
    msb = Wire.receive(); / Whole degrees /
    lsb = Wire.receive(); / Fractional degrees /
    Serial.print(msb,BIN);
    Serial.print(“.”);
    Serial.print(lsb,BIN);
    val = ((msb) 4); / LSB /
    Serial.print(“: ”);
    Serial.print(val0.0625);/ convert to Deg C(>0!)*/
    Serial.print(“: ”);
    Serial.print(val,HEX);
    Serial.print(“\n”);
    delay(1000);
    }
    }

No public wish lists :(