stianeikeland / go-rpio

:electric_plug: Raspberry Pi GPIO library for go-lang
MIT License
2.16k stars 221 forks source link

pullup does not work on RPI 4 B #71

Closed wenwenchenbosch closed 2 years ago

wenwenchenbosch commented 3 years ago

I tried to build and run the pullup example https://github.com/stianeikeland/go-rpio/blob/master/examples/pullup/pullup.go. But it does not build, see error message:

pi@raspberrypi ~/g/e/pullup> go build
# github.com/stianeikeland/go-rpio/v4/examples/pullup
./pullup.go:26:48: pin.ReadPull undefined (type rpio.Pin has no field or method ReadPull)
./pullup.go:30:50: pin.ReadPull undefined (type rpio.Pin has no field or method ReadPull)
note: module requires Go 1.13~

After I removed the ReadPull() call, I got the following output:

pi@raspberrypi ~/g/e/pullup> ./pullup
PullUp: 0, 0
PullDown: 0, 0

That means PullUp does not work.

fdidron commented 3 years ago

@wenwenchenbosch I think this is because the latest tag (v4.4.0) is not pointing to the master branch. @stianeikeland @drahoslove is it possible to tag a new version ?

fdidron commented 3 years ago

@wenwenchenbosch as a workaround what I did was

jkandasa commented 3 years ago

to get the master branch: go get github.com/stianeikeland/go-rpio/v4@master

drahoslove commented 2 years ago

I fixed the examples so they use the modules version 4 now, and I pushed a new tag. It should solve this issue. Feel free to reopen it if it does not.

(also in similar situations it might help to try to delete go mod cache first by go clean --modcache)