Open kadisi opened 5 years ago
ping @stianeikeland
ping @drahoslove
@kadisi Try to look again at your logic, especially the part inside your loop ;)
Hint 1: it's not the same as in your python code.
Hint 2: toggle
Try to look again at your logic, especially the part inside your loop ;) Hint 1: it's not the same as in your python code. Hint 2: toggle
@drahoslove I don't think this is the reason.
Is it a problem with bcm?
my bcm is bcm2711 while go-rpio support bcm2835.
https://github.com/stianeikeland/go-rpio/blob/a36b96d0b1a40b37017d64875275e7e6312408c7/rpio.go#L32
Ah sorry, was too sleepy while responding before, now I see,...
You should use this pin: https://pinout.xyz/pinout/pin33_gpio13
But I'm not sure if bcm2711 is compatible with bcm2835. Maybe it's not.
@drahoslove thanks for responding
i did use 13
in my code.
red := rpio.Pin(13)
red.Output()
did you tested on RPi 4?
This is, I think, due to the Pi 4 having a different GPIO base address than the 3. Moreover, the address is at a different offset in /proc/device-tree/soc/ranges.
The Pi3 has a base address of 0x3f00000, which can be found at offset 4 in /proc/device-tree/soc/ranges. The Pi4 has a base address of 0xfe000000, which is at offset 8.
If you override the return value in getBase(), it works (at least on my Pi 4). I'll take a pass at an update to getBase() but it'll take me a while to get to it.
@wfd3 thanks you.
Turns out it was easier than I thought. Try this patch. I've tested it on my Pi3 and Pi4, but I can't speak to other Pi variants. rpio.patch.txt
@wfd3 This looks good. Could you please create a pull request with this patch, after kadisi confirms it works for him? I don't have a Pi 4 to test it.
@wfd3 i have testd, it works. I am looking forward to your pr。
@drahoslove thank you
Pull Request is in the queue.
go version:
go version go1.12.9 linux/arm
export GO111MODULE=on
go code:
we i run my binary, the red light didn't respond.
pinout
lscpu:
and when i use python to test , it works.