Gobot is great if you want to delegate the "event loop".

If you want to keep control, you may want to take a look periph.io, which
supports interrupt based edge detection
<https://periph.io/x/periph/conn/gpio#example-PinIn>, so no need to do a
busy loop. Which library to use depends about how you want to structure the
control loops, and that's why the two libraries are so different.

Side note; if you care about high performance GPIO
<https://periph.io/news/2017/gpio_perf/>, we're looking to have PRU support
<https://github.com/google/periph/issues/200> which I feel is more useful
on T.I. CPUs than memory mapped GPIO <https://periph.io/x/periph/host/pmem>,
unlike for Broadcom and Allwinner CPUs.

Thanks,

M-A

2018-02-12 8:36 GMT-05:00 Silviu Capota Mera <silviucap...@gmail.com>:

> If you have more time to spare on this project, try to circumvent the
> events / subscriber functionality. Try to see if you can read directly from
> the adaptor:
>
> https://github.com/hybridgroup/gobot/blob/master/platforms/beaglebone/
> beaglebone_adaptor.go#L151
>
> so inside your work function, you would do:
> *dVal, err := beagleboneAdaptor.DigitalRead("P8_8")*
> *if err != nil {*
> *  fmt.Println("Error reading the pin: ", err)*
> *  return*
> *}*
> *fmt.Println("Pin read correctly, the value is: ", dVal)*
>
> Then you would run the program while holding the button on, and off,
> respectively. This way you can tell whether the most basic part of the
> gobot subsystem does its job. That would be a first start at debugging.
> Otherwise, just circumvent it, and read the /sys/class/gpio/[your number]
> through the file system api
>
>
>
> On Mon, Feb 12, 2018 at 1:41 AM, Curtis Paul <curtiswp...@gmail.com>
> wrote:
>
>> I'm at a loss...
>>
>> https://godoc.org/gobot.io/x/gobot#Eventer
>>
>> I think the first thing is that I'm not sure I understand how to diagnose
>> this code....how to validate it's doing what I think it may or may not be
>> doing.
>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "golang-nuts" group.
>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>> pic/golang-nuts/y6ZYXVsfvS0/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> golang-nuts+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to