mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-20 14:39:00 +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:
|
// Here is an example in TinyGo that uses the BMP180 digital barometer:
|
||||||
//
|
//
|
||||||
// package main
|
// package main
|
||||||
//
|
//
|
||||||
// import (
|
// import (
|
||||||
// "time"
|
// "time"
|
||||||
// "machine"
|
// "machine"
|
||||||
//
|
//
|
||||||
// "github.com/tinygo-org/drivers/bmp180"
|
// "github.com/tinygo-org/drivers/bmp180"
|
||||||
// )
|
// )
|
||||||
//
|
//
|
||||||
// func main() {
|
// func main() {
|
||||||
// machine.I2C0.Configure(machine.I2CConfig{})
|
// machine.I2C0.Configure(machine.I2CConfig{})
|
||||||
// sensor := bmp180.New(machine.I2C0)
|
// sensor := bmp180.New(machine.I2C0)
|
||||||
// sensor.Configure()
|
// sensor.Configure()
|
||||||
//
|
//
|
||||||
// connected := sensor.Connected()
|
// connected := sensor.Connected()
|
||||||
// if !connected {
|
// if !connected {
|
||||||
// println("BMP180 not detected")
|
// println("BMP180 not detected")
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
// println("BMP180 detected")
|
// println("BMP180 detected")
|
||||||
//
|
//
|
||||||
// for {
|
// for {
|
||||||
// temp, _ := sensor.Temperature()
|
// temp, _ := sensor.Temperature()
|
||||||
// println("Temperature:", float32(temp)/1000, "ºC")
|
// println("Temperature:", float32(temp)/1000, "ºC")
|
||||||
//
|
//
|
||||||
// pressure, _ := sensor.Pressure()
|
// pressure, _ := sensor.Pressure()
|
||||||
// println("Pressure", float32(pressure)/100000, "hPa")
|
// println("Pressure", float32(pressure)/100000, "hPa")
|
||||||
//
|
//
|
||||||
// time.Sleep(2 * time.Second)
|
// time.Sleep(2 * time.Second)
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user