Class BoardClient

A gRPC-web client for the Board component.

Implements

Constructors

Properties

client: BoardServiceClient
name: string
options: Options

Accessors

  • get boardService(): BoardServiceClient
  • Returns BoardServiceClient

Methods

  • Return the current value of the interrupt which is based on the type of interrupt.

    Parameters

    • digitalInteruptName: string

      The name of the digital interrupt.

    • extra: {} = {}

      Returns Promise<number>

    • Get the high/low state of the given pin of a board.

      Parameters

      • pin: string

        The pin.

      • extra: {} = {}

        Returns Promise<boolean>

      • Get the duty cycle of the given pin of a board.

        Parameters

        • pin: string

          The pin.

        • extra: {} = {}

          Returns Promise<number>

          The duty cycle, which is a value from 0 to 1.

        • Get the PWM frequency of the given pin of a board.

          Parameters

          • pin: string

            The pin.

          • extra: {} = {}

            Returns Promise<number>

          • Get the status of the board.

            Parameters

            • extra: {} = {}

              Returns Promise<{
                  analogs: Record<string, number>;
                  digitalInterrupts: Record<string, number>;
              }>

            • Read the current value of an analog reader of a board.

              Parameters

              • analogReader: string

                The name of the analog reader.

              • extra: {} = {}

                Returns Promise<number>

              • Set the high/low state of the given pin of a board.

                Parameters

                • pin: string

                  The pin.

                • high: boolean

                  When true, set the given pin to high. When false, set the given pin to low.

                • extra: {} = {}

                  Returns Promise<void>

                • Set the duty cycle of the given pin of a board.

                  Parameters

                  • pin: string

                    The pin.

                  • dutyCyle: number

                    A value from 0 to 1.

                  • extra: {} = {}

                    Returns Promise<void>

                  • Set the PWM frequency of the given pin of a board.

                    Parameters

                    • pin: string

                      The pin.

                    • frequencyHz: number

                      The PWM frequency, in hertz. 0 will use the board's default PWM frequency.

                    • extra: {} = {}

                      Returns Promise<void>

                    • Set power mode of the board.

                      Parameters

                      • name: string

                        The name of the board.

                      • powerMode: PowerMode

                        The requested power mode.

                      • Optional duration: AsObject

                        The requested duration to stay in power mode.

                      • extra: {} = {}

                        Returns Promise<void>

                      • Stream digital interrupt ticks on the board.

                        Parameters

                        • interrupts: string[]

                          Names of the interrupts to stream.

                        • queue: Tick[]

                          Array to put the ticks in.

                        • extra: {} = {}

                          Returns Promise<void>

                        • Write an analog value to a pin on the board.

                          Parameters

                          • pin: string

                            The pin name.

                          • value: number

                            An integer value to write.

                          • extra: {} = {}

                            Returns Promise<void>

                          Generated using TypeDoc