mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-05 07:27:49 +00:00
docs: improve godocs formatting
Signed-off-by: Ron Evans <ron@hybridgroup.com>
This commit is contained in:
+22
-22
@@ -3,35 +3,35 @@
|
||||
//
|
||||
// Here is an example in TinyGo that uses the BMP180 digital barometer:
|
||||
//
|
||||
// package main
|
||||
// package main
|
||||
//
|
||||
// import (
|
||||
// "time"
|
||||
// "machine"
|
||||
// import (
|
||||
// "time"
|
||||
// "machine"
|
||||
//
|
||||
// "github.com/tinygo-org/drivers/bmp180"
|
||||
// )
|
||||
// "github.com/tinygo-org/drivers/bmp180"
|
||||
// )
|
||||
//
|
||||
// func main() {
|
||||
// machine.I2C0.Configure(machine.I2CConfig{})
|
||||
// sensor := bmp180.New(machine.I2C0)
|
||||
// sensor.Configure()
|
||||
// func main() {
|
||||
// machine.I2C0.Configure(machine.I2CConfig{})
|
||||
// sensor := bmp180.New(machine.I2C0)
|
||||
// sensor.Configure()
|
||||
//
|
||||
// connected := sensor.Connected()
|
||||
// if !connected {
|
||||
// println("BMP180 not detected")
|
||||
// return
|
||||
// }
|
||||
// println("BMP180 detected")
|
||||
// connected := sensor.Connected()
|
||||
// if !connected {
|
||||
// println("BMP180 not detected")
|
||||
// return
|
||||
// }
|
||||
// println("BMP180 detected")
|
||||
//
|
||||
// for {
|
||||
// temp, _ := sensor.Temperature()
|
||||
// println("Temperature:", float32(temp)/1000, "ºC")
|
||||
// for {
|
||||
// temp, _ := sensor.Temperature()
|
||||
// println("Temperature:", float32(temp)/1000, "ºC")
|
||||
//
|
||||
// pressure, _ := sensor.Pressure()
|
||||
// println("Pressure", float32(pressure)/100000, "hPa")
|
||||
// pressure, _ := sensor.Pressure()
|
||||
// println("Pressure", float32(pressure)/100000, "hPa")
|
||||
//
|
||||
// time.Sleep(2 * time.Second)
|
||||
// time.Sleep(2 * time.Second)
|
||||
// }
|
||||
// }
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user