Module: valve

This module creates and manages the 8 valves in the system. Each valve has 1 input and 2 outputs. // * The input (I2C) causes the valve to open or closes. There is a GPIO output set when the valve is fully closed and fully open. After each open or close command, the state of the valve is verified by waiting upon the valve to indicate that it is open or closed.
Author:
  • Dave Leitch

Requires

Classes

Valve

Members


<inner, constant> VALVE_CLOSE_REQUEST :number

I2C value used to CLOSE the valve.
Type:
  • number

<inner, constant> VALVE_DEFS

Definitions for all valves.
Properties:
Name Type Description
name string Unique valve name.
i2cPinOut number I2C pin number used to actuate the valve.
pinOpened number GPIO pin number connected to open signal from the valve.
pinClosed number GPIO pin number connected to close signal from the valve.

<inner, constant> VALVE_OPEN_REQUEST :number

I2C value used to OPEN the valve.
Type:
  • number

Methods


<static> close(name)

Close a valve by name
Parameters:
Name Type Description
name string Valve name

<static> getStatus()

Get the status of all valves
Fires:
  • event:valve

<static> open(name)

Open a valve by name
Parameters:
Name Type Description
name string Valve name

<static> start()

Initialize the valve driver and close it. 8 valves are created from initial values.