mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-05 15:33:42 +00:00
bmp180: change method names/signature for obtaining temperature and pressure uniform with other similar drivers
Signed-off-by: Ron Evans <ron@hybridgroup.com>
This commit is contained in:
@@ -3,8 +3,9 @@ package main
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/tinygo-org/drivers/bmp180"
|
||||
"machine"
|
||||
|
||||
"github.com/tinygo-org/drivers/bmp180"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -20,10 +21,10 @@ func main() {
|
||||
println("BMP180 detected")
|
||||
|
||||
for {
|
||||
temp, _ := sensor.Temperature()
|
||||
temp, _ := sensor.ReadTemperature()
|
||||
println("Temperature:", float32(temp)/1000, "ºC")
|
||||
|
||||
pressure, _ := sensor.Pressure()
|
||||
pressure, _ := sensor.ReadPressure()
|
||||
println("Pressure", float32(pressure)/100000, "hPa")
|
||||
|
||||
time.Sleep(2 * time.Second)
|
||||
|
||||
Reference in New Issue
Block a user