hwio icon indicating copy to clipboard operation
hwio copied to clipboard

could not find a pin

Open mtavano opened this issue 8 years ago • 2 comments

I worked with hwio the past February, and everything worked OK, but now when I've tried to work with the same codebase, this error message came up: Could not find a pin called gpio2

my code looks like this

package main

import (
	"log"

	"github.com/mrmorphic/hwio"
)

func main() {
	gpio, err := hwio.GetPinWithMode("gpio2", hwio.OUTPUT)
	check(err)
	defer hwio.CloseAll()

	err = hwio.DigitalWrite(gpio, hwio.HIGH)
	check(err)
	err = hwio.DigitalWrite(gpio, hwio.LOW)
	check(err)
}

func check(err error) {
	if err != nil {
		log.Fatal(err)
	}
}

Ofcourse, I've tried with many differents pins.

mtavano avatar Sep 20 '17 20:09 mtavano

That's odd. There have been no changes in the library that would effect that. What device are you using? Also, have there been any updates to the device?

mrmorphic avatar Sep 20 '17 21:09 mrmorphic

I've created issue https://github.com/mrmorphic/hwio/issues/53 in order to add board revisions that are currently missing from driver selection. If you're running the same code on a model 3 board, this is probably what's going on.

mrmorphic avatar Oct 02 '17 03:10 mrmorphic