Read TMP102 with XIAO ESP32-C3 (Arduino Framework)

Read TMP102 with XIAO ESP32C3 (in Arduino Framework) using Temperature_LM75_Derived.


Connection:
TMP102	XIAO ESP32-C3
---------------------
VCC		3V3
GND		GND
SDA		SDA/D4
SCL		SCL/D5
Install I2C Temperature Sensors derived from the LM75. This library supports a large range of I²C temperature sensors based on the industry-standard LM75 package.

Click on File > Examples > I2C Temperature Sensors derived from the LM75 > BasicUsage

To run on ESP32C3, comment the line:
while(!Serial) {}

/*
Read the temperature from an LM75-derived temperature sensor, and display it
in Celcius every 250ms. Any LM75-derived temperature should work.
*/

#include <Temperature_LM75_Derived.h>

// The Generic_LM75 class will provide 9-bit (±0.5°C) temperature for any
// LM75-derived sensor. More specific classes may provide better resolution.
Generic_LM75 temperature;

void setup() {
  //while(!Serial) {}
  
  Serial.begin(9600);

  Wire.begin();
}

void loop() {
  Serial.print("Temperature = ");
  Serial.print(temperature.readTemperatureC());
  Serial.println(" C");

  delay(250);
}


Comments

Popular posts from this blog

480x320 TFT/ILI9488 SPI wih EP32C3 (arduino-esp32) using Arduino_GFX Library

my dev.tools - FNIRSI 2C23T 3-in-1 Dual Channel Oscilloscope/Multimeter/Signal Generator