diff --git a/examples/blinker/blinker.go b/examples/blinker/blinker.go index 8792b88..00fd653 100644 --- a/examples/blinker/blinker.go +++ b/examples/blinker/blinker.go @@ -17,11 +17,6 @@ import ( "time" ) -var ( - // Use mcu pin 10, corresponds to physical pin 19 on the pi - pin = rpio.Pin(10) -) - func main() { // Open and map memory to access gpio, check for errors if err := rpio.Open(); err != nil { @@ -32,6 +27,13 @@ func main() { // Unmap gpio memory when done defer rpio.Close() + // Use physical pin 19, mappings to GPIO numers are done internally + pin, err := rpio.GetBoardPin(19) + if err != nil { + fmt.Println(err) + os.Exit(1) + } + // Set pin to output mode pin.Output()