Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*The 30205 body temperature sensor is a non-contact infrared temperature sensor that measures the temperature of an object by sensing the infrared radiation emitted from it. Here's an example code in Arduino that reads the temperature from a 30205 sensor connected to an Arduino board:
- Note: This code assumes that the 30205 sensor is connected to the I2C bus of the Arduino board. If you're using a different I2C bus or pins, you'll need to modify the mlx initialization accordingly.
- */
- #include <Adafruit_MLX90614.h>
- Adafruit_MLX90614 mlx = Adafruit_MLX90614();
- void setup() {
- Serial.begin(9600);
- mlx.begin();
- }
- void loop() {
- // read the temperature from the sensor
- float temp = mlx.readObjectTempC();
- // print the temperature
- Serial.print("Temperature: ");
- Serial.print(temp);
- Serial.println(" °C");
- // delay before reading from the sensor again
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement