Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 851 Bytes

edge_counter.rst

File metadata and controls

38 lines (24 loc) · 851 Bytes

edge counter

edge_counter(name, pin, rising=true, falling=true);

Create a new input port for an edge_counter, measuring either a falling or rising edge on the respective input port. name will be appended to the mqtt topic and a trigger count will be published there.

Parameters

  • name: the name it can be addressed via MQTT in the network. Inside the code it can be addressed via IN(name).
  • pin: the gpio pin
  • rising: if true, count rising edges
  • falling: if true, count falling edges
  • .with_pullup(false) can be used to disable internal pullup (default enabled)

Example

node name: living room/shock1

edge_counter(left, D3);

Now, the number of rising and falling edges is published as living room/shock1/left