Formats the raw values received from digital reads of pin state, or digital events.
The type specified is a keyword.
Formats the raw values received from digital reads of pin state, or digital events. The type specified is a keyword.
(create-edge-channel port)
Returns a core.async channel on which events will be put
Returns a core.async channel on which events will be put
(release-edge-channel! port channel)
(set-edge! providor setting)
(read-value port)
Return the value of the port
Return the value of the port
(set-active-low! port active-low?)
Invert the logic of the value pin for both reading and writing so that a high == 0 and low == 1.
Invert the logic of the value pin for both reading and writing so that a high == 0 and low == 1.
(set-direction! port direction)
Sets the direction of this port: in or out.
Sets the direction of this port: in or out.
(toggle! port)
Flips the value of the port
Flips the value of the port
(write-value! port value)
Writes the value to the port. The value may be specified as :high
, :low
(and symbol or string variations), , �, or 1, 0
Writes the value to the port. The value may be specified as `:high`, `:low` (and symbol or string variations), , , or 1, 0
(open-channel-port port & opts)
Opens a port which can be used for listening to value changes. In addition to the
options map for open-port
, the following are available:
:event-buffer-size
- the size of the change events buffer. Defaults to 1:timeout
- sets a timeout for the OS polling wait time. Defaults to -1, which waits indefinitely:edge
- sets the edge value- :rising
, :falling
, or :both
Opens a port which can be used for listening to value changes. In addition to the options map for [[open-port]], the following are available: * `:event-buffer-size` - the size of the change events buffer. Defaults to 1 * `:timeout` - sets a timeout for the OS polling wait time. Defaults to -1, which waits indefinitely * `:edge` - sets the edge value- `:rising`, `:falling`, or `:both`
(open-port port & opts)
Opens a port from which values may be read or written. Args:
port
- the gpio pin number:direction
- sets the initial direction:active-low?
- sets the port as "active low", value true or false:initial-value
- sets the intitial value of the pin.:digital-result-format
- describes the format for digital values on read
This can be one of #{:keyword :symbol :integer :boolean :char}
:from-raw-fn
- a converter function, which takes the char
value ( or �) read and converts it into a meaningful value.
Overrides the default formatterOpens a port from which values may be read or written. Args: * `port` - the gpio pin number * opts: optional keyword args * `:direction` - sets the initial direction * `:active-low?` - sets the port as "active low", value true or false * `:initial-value` - sets the intitial value of the pin. * `:digital-result-format` - describes the format for digital values on read This can be one of `#{:keyword :symbol :integer :boolean :char}` * `:from-raw-fn` - a converter function, which takes the `char` value ( or ) read and converts it into a meaningful value. Overrides the default formatter
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close