FrequencySensor Class

Definition

The frequency extension allows detecting the frequency of a signal at a given pin. This extension is supported on gpio pins that support interrupts.

public class FrequencySensor : Iot.Device.Arduino.ExtendedCommandHandler
type FrequencySensor = class
    inherit ExtendedCommandHandler
Public Class FrequencySensor
Inherits ExtendedCommandHandler
Inheritance
FrequencySensor

Constructors

FrequencySensor()

Creates a new instance of this class. This supports pins that have the "Frequency" mode enabled.

Properties

Board

The reference to the arduino board

(Inherited from ExtendedCommandHandler)
HandlesMode

The pin mode this handler supports.

(Inherited from ExtendedCommandHandler)
IsRegistered

Returns true if this command handler is registered. This might need to be checked in Dispose, to make sure an uninitialized component doesn't attempt to send a command.

(Inherited from ExtendedCommandHandler)
Logger

The class-specific logger instance

(Inherited from ExtendedCommandHandler)

Methods

DisableFrequencyReporting(Int32)

Disables automatic updating of the frequency counter for the given pin

Dispose() (Inherited from ExtendedCommandHandler)
Dispose(Boolean)

Disposes this instance

EnableFrequencyReporting(Int32, FrequencyMode, Int32)

Enable frequency reporting on the given pin.

GetMeasuredFrequency()

Returns the last measured frequency. Returns 0 if no frequency measurement is active.

HasCommandError(FirmataCommandSequence, Byte[])

Callback function that returns whether the given reply indicates an error

(Inherited from ExtendedCommandHandler)
IsMatchingAck(FirmataCommandSequence, Byte[])

This method is called to check whether the reply is a valid ACK/NOACK for the given command sequence. Can be used to avoid accepting something as command reply that is completely unrelated (such as an asynchronous callback). In different words, this should return false if the given reply is not something that is an answer to a synchronous command.

(Inherited from ExtendedCommandHandler)
OnConnected()

This method is called when a connection to the hardware is established.

OnErrorMessage(String, Exception)

Called by the infrastructure when the parser reports an error or information message. The default implementation does nothing.

(Inherited from ExtendedCommandHandler)
OnSysexData(ReplyType, Byte[])

This is called when a sysex command is received from the board. This can include the reply to a command sent by a SendCommandAndWait(FirmataCommandSequence) before, in which case the reply should be ignored, as it is returned as result of the call itself. Therefore it is advised to use this function only to listen for data sent by the device automatically (e.g event messages or recurring status reports)

SendCommand(FirmataCommandSequence)

Sends a command to the device, not expecting an answer.

(Inherited from ExtendedCommandHandler)
SendCommandAndWait(FirmataCommandSequence)

Send a command to the device, expecting a reply. This uses a default timeout.

(Inherited from ExtendedCommandHandler)
SendCommandAndWait(FirmataCommandSequence, TimeSpan)

Send a command to the device, expecting a reply.

(Inherited from ExtendedCommandHandler)
SendCommandAndWait(FirmataCommandSequence, TimeSpan, CommandError)

Send a command to the device, expecting a reply.

(Inherited from ExtendedCommandHandler)
SendCommandsAndWait(IList<FirmataCommandSequence>, TimeSpan, CommandError)

Send a command to the device, expecting a reply.

(Inherited from ExtendedCommandHandler)

Applies to