{"id":15290586,"url":"https://github.com/d2r2/go-mpl3115a2","last_synced_at":"2026-04-28T00:31:11.873Z","repository":{"id":57548857,"uuid":"157346434","full_name":"d2r2/go-mpl3115a2","owner":"d2r2","description":"Golang library to interact with MPL3115A2 pressure and altitude sensor from Raspberry PI.","archived":false,"fork":false,"pushed_at":"2018-11-13T08:34:40.000Z","size":1543,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-13T09:19:58.973Z","etag":null,"topics":["golang","gpio","i2c","i2c-sensors","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d2r2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-13T08:33:06.000Z","updated_at":"2020-12-08T19:29:07.000Z","dependencies_parsed_at":"2022-08-28T12:21:02.417Z","dependency_job_id":null,"html_url":"https://github.com/d2r2/go-mpl3115a2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/d2r2/go-mpl3115a2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2r2%2Fgo-mpl3115a2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2r2%2Fgo-mpl3115a2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2r2%2Fgo-mpl3115a2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2r2%2Fgo-mpl3115a2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d2r2","download_url":"https://codeload.github.com/d2r2/go-mpl3115a2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2r2%2Fgo-mpl3115a2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32361477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","gpio","i2c","i2c-sensors","raspberry-pi"],"created_at":"2024-09-30T16:08:42.091Z","updated_at":"2026-04-28T00:31:11.858Z","avatar_url":"https://github.com/d2r2.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"NXP Semiconductors MPL3115A2 pressure and temperature sensor\n============================================================\n\n[![Build Status](https://travis-ci.org/d2r2/go-mpl3115a2.svg?branch=master)](https://travis-ci.org/d2r2/go-mpl3115a2)\n[![Go Report Card](https://goreportcard.com/badge/github.com/d2r2/go-mpl3115a2)](https://goreportcard.com/report/github.com/d2r2/go-mpl3115a2)\n[![GoDoc](https://godoc.org/github.com/d2r2/go-mpl3115a2?status.svg)](https://godoc.org/github.com/d2r2/go-mpl3115a2)\n[![MIT License](http://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)\n\nMPL3115A2 ([pdf reference](https://raw.github.com/d2r2/go-mpl3115a2/master/docs/mpl3115a2.pdf)) is a popular sensor among Arduino and Raspberry PI developers.\nSensor is a compact, piezoresistive, pressure and temperature sensor with an I2C digital interface:\n![image](https://raw.github.com/d2r2/go-mpl3115a2/master/docs/mpl3115a2.jpg)\n\nHere is a library written in [Go programming language](https://golang.org/) for Raspberry PI and counterparts, which gives you in the output temperature, atmospheric pressure and altitude values (making all necessary i2c-bus interacting and values computing).\n\nGolang usage\n------------\n\n\n```go\nfunc main() {\n\t// Create new connection to i2c-bus on 0 line with address 0x60.\n\t// Use i2cdetect utility to find device address over the i2c-bus\n\ti2c, err := i2c.NewI2C(0x60, 0)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer i2c.Close()\n\n\tsensor := mpl3115a2.NewMPL3115A2()\n\n\t// Oversample Ratio - define precision, from low(0) to high(7)\n\tosr := 3\n\tp, t, err := sensor.MeasurePressure(i2c, osr)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Printf(\"Pressure = %v Pa, temperature = %v *C\", p, t)\n\n\tp, t, err = sensor.MeasureAltitude(i2c, osr)\n\tif err != nil {\n\t\tlg.Fatal(err)\n\t}\n\tlog.Printf(\"Altitude = %v m, temperature = %v *C\", p, t)\n}\n```\n\n\nGetting help\n------------\n\nGoDoc [documentation](http://godoc.org/github.com/d2r2/go-mpl3115a2)\n\nInstallation\n------------\n\n```bash\n$ go get -u github.com/d2r2/go-mpl3115a2\n```\n\nTroubleshooting\n--------------\n\n- *How to obtain fresh Golang installation to RPi device (either any RPi clone):*\nIf your RaspberryPI golang installation taken by default from repository is outdated, you may consider\nto install actual golang manually from official Golang [site](https://golang.org/dl/). Download\ntar.gz file containing armv6l in the name. Follow installation instructions.\n\n- *How to enable I2C bus on RPi device:*\nIf you employ RaspberryPI, use raspi-config utility to activate i2c-bus on the OS level.\nGo to \"Interfacing Options\" menu, to active I2C bus.\nProbably you will need to reboot to load i2c kernel module.\nFinally you should have device like /dev/i2c-1 present in the system.\n\n- *How to find I2C bus allocation and device address:*\nUse i2cdetect utility in format \"i2cdetect -y X\", where X may vary from 0 to 5 or more,\nto discover address occupied by peripheral device. To install utility you should run\n`apt install i2c-tools` on debian-kind system. `i2cdetect -y 1` sample output:\n\t```\n\t     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f\n\t00:          -- -- -- -- -- -- -- -- -- -- -- -- --\n\t10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\t20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\t30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\t40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\t50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\t60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\t70: -- -- -- -- -- -- 76 --    \n\t```\n\nContact\n-------\n\nPlease use [Github issue tracker](https://github.com/d2r2/go-mpl3115a2/issues) for filing bugs or feature requests.\n\n\nLicense\n-------\n\nGo-mpl3115a2 is licensed under MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd2r2%2Fgo-mpl3115a2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd2r2%2Fgo-mpl3115a2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd2r2%2Fgo-mpl3115a2/lists"}