I2C eagle Tree Airspeed sensor
Istha Powron
Posts: 74
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
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
Apparently only pins 0&1 and 8&9 work for I2C.
I
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
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