Yep, my Arduino UNO R3 has delivered to me few weeks ago, and I started to do my project.
The sensor and devices I use are 1 LCD 1602 and 1 MLX90614 refer to the post. However, as they are using i2c interface while I'm not sure I've understood how i2c works exactly.
What I know is that UNO R3 has a built-in pull-up resistor so I should be able to connect them both to the same two i2c pins by soldering them into 1 cable for SDA and 1 cable for SCL and plug them into Arduino's SDA and SCL pins, and they should work without any problems.
Is that right?
I have just written the code for them:
#include <LiquidCrystal_I2C.h>
#include <Adafruit_MLX90614.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); // I2C address 0x27, 16 column and 2 rows
Adafruit_MLX90614 mlx = Adafruit_MLX90614();
void setup()
{
lcd.init();
lcd.backlight();
mlx.begin();
}
void loop()
{
lcd.clear(); // clear display
lcd.setCursor(0, 0); // move cursor to (0, 0)
lcd.print("Temp:"); // print message at (0, 0)
lcd.print((mlx.readObjectTempC()));
lcd.print((char)223);
lcd.print("C");
delay(2000); // display the above for two seconds
}
Is that okay? Thanks for all helping for this project!