Shop OBEX P1 Docs P2 Docs Learn Events
Help with I2C Air Sensor — Parallax Forums

Help with I2C Air Sensor

Istha PowronIstha Powron Posts: 74
edited 2010-03-03 10:41 in General Discussion
Good morning all,

I am trying to read an eagle tree airspeed sensor and have absolutely NO idea of what I'm doing.

The data sheet is not fantastic;

http://www.eagletreesystems.com/support/manuals/microsensor-i2c.pdf

Here is the code I have written;

' {$STAMP BS2px}
' {$PBASIC 2.5}

SDA PIN 13 ' I2C SDA pin
SCL PIN 12

addr VAR Word ' internal address
result VAR Byte(2) ' array for returned value
speed VAR Word

START:

DEBUG CR, "Reading...", CR
PAUSE 1000

addr = $EA
I2CIN SDA, addr, [noparse][[/noparse]STR result\2]

speed = result(0)*256 + result(1)
DEBUG "out 0 = ", speed

GOTO START

END

I'm very confused as to the difference between slave ID and address.

Any help would be great.

Thank's,

Istha

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔





The robot is going to lose. Not by much. But when the final score is tallied, flesh and blood will beat the damn monster.
Adam Smith

Comments

  • Istha PowronIstha Powron Posts: 74
    edited 2010-03-03 10:41
    Sorry,

    Just realized I put this in the wrong forum.

    Apologies.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔





    The robot is going to lose. Not by much. But when the final score is tallied, flesh and blood will beat the damn monster.
    Adam Smith
Sign In or Register to comment.