mirror of
https://github.com/kidoman/embd
synced 2025-01-03 10:31:36 +01:00
gpio: add short analog (bbb) example
This commit is contained in:
parent
3a072d013b
commit
0ac16b97dd
1
samples/.gitignore
vendored
1
samples/.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
analog
|
analog
|
||||||
|
analogshort
|
||||||
bh1750fvi
|
bh1750fvi
|
||||||
bmp085
|
bmp085
|
||||||
bmp180
|
bmp180
|
||||||
|
17
samples/analogshort.go
Normal file
17
samples/analogshort.go
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// +build ignore
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
"github.com/kidoman/embd"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
embd.InitGPIO()
|
||||||
|
defer embd.CloseGPIO()
|
||||||
|
|
||||||
|
val, _ := embd.AnalogRead(0)
|
||||||
|
fmt.Printf("Reading: %v\n", val)
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user