Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Golang library to read data from Bosch BME280 sensor.

License

NotificationsYou must be signed in to change notification settings

quhar/bme280

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoDoc

Golang library to read data from Bosch BME280 sensor. It requires library to talk to the device via following interface:

typebusinterface {ReadReg(byte, []byte)errorWriteReg(byte, []byte)error}

One of the libraries which matches this interface is experimental standard I/Olib.

Example usage

package mainimport ("fmt""golang.org/x/exp/io/i2c""github.com/quhar/bme280")funcmain() {d,err:=i2c.Open(&i2c.Devfs{Dev:"/dev/i2c-1"},bme280.I2CAddr)iferr!=nil {panic(err)}b:=bme280.New(d)err=b.Init()t,p,h,err:=b.EnvData()iferr!=nil {panic(err)}fmt.Printf("Temp: %fC, Press: %fhPa, Hum: %f%%\n",t,p,h)}

About

Golang library to read data from Bosch BME280 sensor.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp