Skip to content

ataboo/mlx90614-golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MLX90614-golang

Golang library for reading from an MLX90614 thermal sensor over i2c.

Basic Usage

// Make a config and change any values needed
cnf := config.DefaultConfig()
cnf.I2CPath = "/dev/i2c-2"

// Make a sensor with the config
irSensor := sensor.NewIrSensor(cnf)

// Defer closing the i2c connection
defer irSensor.Close()

// Connect the sensor
if err := irSensor.Connect(); err != nil {
  log.Fatal("failed to connect")
}

// Update tempurature
irSensor.ReadTemps()

// Get temp values
fmt.Printf("\nAmbient temp: %.1f" irSensor.AmbientTemp.Kelvin())
fmt.Println(irSensor.ObjectTemp.CelsiusPretty())
fmt.Println(irSensor.ObjectTemp.FahrenheitPretty())

About

Golang library for reading from an MLX90614 thermal sensor over i2c

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages