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?