We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 904f4f9 commit b79c58aCopy full SHA for b79c58a
examples/blinker/blinker.go
@@ -17,11 +17,6 @@ import (
17
"time"
18
)
19
20
-var (
21
- // Use mcu pin 10, corresponds to physical pin 19 on the pi
22
- pin = rpio.Pin(10)
23
-)
24
-
25
func main() {
26
// Open and map memory to access gpio, check for errors
27
if err := rpio.Open(); err != nil {
@@ -32,6 +27,13 @@ func main() {
32
// Unmap gpio memory when done
33
28
defer rpio.Close()
34
29
30
+ // Use physical pin 19, mappings to GPIO numers are done internally
31
+ pin, err := rpio.GetBoardPin(19)
+ if err != nil {
+ fmt.Println(err)
+ os.Exit(1)
35
+ }
36
+
37
// Set pin to output mode
38
pin.Output()
39
0 commit comments