Julia, PiGPIO for Button control

I’m new to Julia and I’m just toying with the language on Raspberry Pi with the PiGPIO library. Is there doc on how to use the PiGPIO.callback function to monitor Edge transitions? I can see the method, but no examples.

More specifically, I have code that looks like:

  function gpioCallback(gpio, level, tick)
     println("gpioCallback")
  end
  ...

  remotePi=Pi()
  println("Connected to " * remotePi.host)
  ...


  println("Testing callbacks")
  set_mode(remotePi,26,PiGPIO.INPUT)
  cb = PiGPIO.callback(remotePi,26,PiGPIO.FALLING_EDGE,gpioCallback)

The error I see indicates that I need some initialization of the Pi struct (remotePi)

  **[ Info:** Successfully connected!
  Connected to raspberrypi
  Testing callbacks
  **ERROR:** LoadError: type Pi has no field _notify

  Stacktrace:
  [1] **getproperty(** ::Pi, ::Symbol **)** at **./Base.jl:33**
  [2] **callback(** ::Pi, ::Int64, ::Int64, ::Function **)** at 
  **/Users/hub/.julia/packages/PiGPIO/bH87w/src/pi.jl:1229**
  [3] top-level scope at **/Users/hub/Julia/TestPi.jl:25**
  [4] **include(** ::Function, ::Module, ::String **)** at **./Base.jl:380**
  [5] **include(** ::Module, ::String **)** at **./Base.jl:368**
  [6] **exec_options(** ::Base.JLOptions **)** at **./client.jl:296**
  [7] **_start()** at **./client.jl:506**
  in expression starting at /Users/hub/Julia/TestPi.jl:25

Any thoughts?

That looks like a bug. Looking at the source, _notify is accessed several times but only notify is defined or written. I think all instances of _notify in that file should be notify.

Thanks, I’ll check to see if there is a newer package.

Hi, any follow up on this issue ? I have the same error when using PiGPIO.callback .

Hi all, I am also looking for some help with PiGPIO. It would be great to see some examples in Julia for acquiring sensor inputs using I2C and SPI protocols, but I can’t find any examples whatsoever!