Hi everybody,
I'm trying to interface an arduino to the MOD-TC-MK2-31855 sensor board, but I'm having many difficulties getting data. I post here the sketch I wrote. Is it correct, or am I doing something wrong?? I'm getting all 255 int values.
Thank you very much,
#include <Wire.h>
void setup(){
pinMode(A4, INPUT);
pinMode(A5, INPUT);
Wire.begin();
Serial.begin(9600);
}
void loop(){
Wire.beginTransmission(byte(0x48));
Wire.write(0x01);
Wire.write(0xA0);
Wire.write(byte(0x23));
Wire.endTransmission();
//Wire.beginTransmission(byte(0x48));
Wire.requestFrom(0x48,4);
//Wire.endTransmission();
byte c[4];
int i=0;
Serial.print("Start geting data");
while(Wire.available())
{
c[i] =Wire.read();
Serial.print(int(c[i]));
i++;
}
delay(1000);
}
Hi Enrico,
Replace
Wire.write(byte(0x23))
with
Wire.write(byte(0x21))
If this doesn't work for you try to reduce slightly I2C speed to 80kHz.
Edit twi.h file (Arduino_dir/libraries/Wire/utilites/):
#define TWI_FREQ 80000L
AVR-T32U4 #Arduino Leonardo measure temperatures from -250C to +1600C with thermocouples http://olimex.wordpress.com/2013/05/28/measuring-temperatures-from-250c-to-1600c-with-avr-t32u4-arduino-leonardo-and-mod-tc-mk2-31885-thermocouple/ ...
Thank you :D
do you know if you can connect together 2or more of mk2 to A4, A5?
yes, many MK2 can be connected on same I2C bus as they could have different addresses
how to change address?
do you have a picture of how to connect to arduino? thanks
now it works!! WOW
sorry, how to change address?