Go Down

Topic: Using a temperature sensor I2C. Where do registers come into code? (Read 1 time) previous topic - next topic

Grumpy_Mike

Quote
Do you have any guidance on using bit shift,

http://arduino.cc/en/Reference/Bitshift

Quote
is the bit in the examples in the IDE entitled strings relevant?

No.

R3dEyedFox

The other dude pretty much explained bitshifting, here is the ref page
http://arduino.cc/en/Reference/Bitshift

the temp is received in raw data, you need to convert the raw value into Celsius

writing some variables that hold the temperature value might be helpful

Richard_N

Ok then two more things to clarify from your repsonses, but I think it's becoming clear.

Where you've put 0x00 I'll put 0000000 (the register pointer for ambient temp register?)

I want all of the first byte and to "add" the first bit of the second byte on the end?

What's the function called to join the two pieces of data after I've done the bit shifting?

Grumpy_Mike

Quote
Where you've put 0x00 I'll put 0000000 (the register pointer for ambient temp register?)

Yes.
Quote
I want all of the first byte and to "add" the first bit of the second byte on the end?

Yes.

Quote
What's the function called to join the two pieces of data after I've done the bit shifting?

The full name is the inclusive OR function the operation symbol is a single | ( that is not an i or an l )

Richard_N

Thanks very much I'll post back with my finished code later on.

I appreciate your patience with a useless mechanical engineer currently getting lost in the world of programming

Go Up