mirror of
https://github.com/kidoman/embd
synced 2024-12-22 12:50:19 +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
|
||||
analogshort
|
||||
bh1750fvi
|
||||
bmp085
|
||||
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