So the getters do not return the actual value - you need to use the event callback.
I2C queries/getters on Crow
Queries are values that can be requested from a connected device. This could be asking a clock device for it’s tempo , or an analog input device for the voltage at one of it’s inputs.
crow uses a query -> event model, which is different from teletype which has a functional approach. In teletype, you call the getter, it requests the value, waits to receive it, then returns that value as it’s result directly.
crow’s query -> event model separates the request from the response . While this approach is a little more complex, it allows crow to do a great many other things while it waits for a response to it’s request.
First you use ii.<module>.get( name, ... ) , which again can be copied directly from the device’s help() call. The ... here refers to a variable list of arguments which might be none at all! eg: ii.jf.get( 'run_mode' )
Then you can declare an event action to handle the response from the device. Copy it from the help() printout! it should look something like:
ii.jf.event( event, data )
if event == 'run_mode' then
-- the state of 'run_mode' is in the 'data' variable!
end
end
Note that by default the event() defaults to a satellite action which is ^^ii.<module>(<event>,<value>) for eg: ^^ii.txi('value', 0.1)