Class Anemometer

Represents an Anemometer device for measuring wind speed using a PCF8583 real-time clock module. This class allows you to read wind speed data, calculate wind speed values, and maintain a history of pulse counts to determine wind speed over time.

Hierarchy

  • Anemometer

Constructors

Accessors

Methods

Constructors

  • Creates an instance of the Anemometer class, which interfaces with a PCF8583 module.

    Parameters

    • calc: ((pulses, time) => WindSpeed)

      A function that calculates WindSpeed based on pulse count and time.

    • opts: AnemometerOptions = {}

      Optional configuration options for the Anemometer.

    Returns Anemometer

Accessors

  • get isReady(): boolean
  • Indicator of whether a connection has been established and the data is being read..

    Returns boolean

    true if the connection is ready; otherwise, false.

Methods

  • Closes the i2c connection and stops reading prozess.

    Returns Promise<void>

    A promise that resolves when the Anemometer is successfully closed.

    Async

  • Calculates the average wind speed of the past x seconds.

    Parameters

    • time: number

      The offset for which to retrieve wind speed data.

    Returns WindSpeed

    The average WindSpeed data for the specified time.

  • Opens the i2c connection and start the reading data.

    Returns Promise<void>

    A promise that resolves when the connection is successfully opened.

    Async

Generated using TypeDoc