MSDN Code Gallery Wiki Documentation

Rhyduino.AnalogPin

Class used to evaluate the values received from an analog pin.

Properties

  • CacheSize Gets or sets the number of previous pin values to keep a record of. Changing this value clears the cache.
  • Monitor Gets or sets the monitoring state of the pin. If true, the value of the pin will be updated approximately 50 times a second.
  • SmoothedValue Gets the smoothed value of the pin. The smoothed value is the average of the values in the smoothing range.
  • SmoothingRange Gets or sets the number of values to use as the base for calculating the smoothed value.
  • Value The most recently reported value for the analog pin.

Methods

  • #ctor(Rhyduino.Arduino,System.Int32,System.Int32,System.Collections.Generic.ICollection{System.Int32}) Constructs an instance of the class.
  • GetCachedValues The cached pin values. The values are listed in the order they were received.

Events

Rhyduino.AnalogPins

Class for managing the state of the analog pins.

Properties

  • Item(System.Int32) Gets the pin information for the specified analog pin.

Methods

Events

Rhyduino.Arduino

The main class used for communicating with and controlling a connected device.

Properties

  • AnalogPins Provides access to the analog pin state and cache.
  • BaudRate Gets the baud rate that the serial port is configured to operate at.
  • DigitalPins The object which controls digital pin state.
  • FirmataMajorVersion Gets the major protocol version number reported by the remote device. Null if not reported.
  • FirmataMinorVersion Gets the minor protocol version number reported by the remote device. Null if not reported.
  • FirmataName Gets the Firmata name as reported by the remote device. Null if not reported.
  • IsConnected Returns true, if a connection is active between the computer and the device.
  • PortName Gets the name of the serial port that the Arduino object is configured to use.
  • SerialPort The serial port that the Arduino is configured to use.

Methods

  • #ctor(System.String,System.Int32,System.Boolean) Creates and initializes a new instance of the Arduino class.
  • Connect Open a serial connection to the attached device. No action is performed if the serial port is already open.
  • Disconnect Close the serial connection to the attached device.
  • Dispose Disposes the object by releasing referenced memory.
  • Dispose(System.Boolean) Disposes the object by releasing referenced memory.
  • Finalize Disposes the object by releasing referenced memory.
  • OnAnalogPinReportReceived(Rhyduino.Message.AnalogPinReport) Occurs when a message reporting the value of an analog pin is received.
  • OnDigitalPinValueChange(System.Int32,Rhyduino.DigitalPinValue) Occurs when the value of a monitored digital pin changes.
  • OnDigitalPortReportReceived(Rhyduino.Message.DigitalPortReport) Occurs when a message reporting the value of a digital port is received.
  • OnFirmataVersionReportReceived(Rhyduino.Message.FirmataVersionReport) Occurs when a message reporting the remote Firmata protocol version is received.
  • OnUnknownMessageReceived(Rhyduino.Message.FirmataMessage) Occurs when a message was received but was in an unrecognizable format.
  • Post(System.Byte[]) Posts a message to the attached device.

Events

  • AnalogPinReportReceived Occurs when a message containing data describing an analog pin is received.
  • DigitalPinValueChanged Occurs when the value of a digital pin changes.
  • FirmataVersionReportReceived Occurs when a message containing data describing the firmware version used on the target device is received.
  • MessagePosted Occurs when an outgoing message is posted on the serial port. Future versions of the library will contain the body of the post in the event data. For now, this is just used for limited monitoring of the application.
  • UnknownMessageReceived Occurs when a message is received but cannot be classified. This could indicate a number of things, none of them good. Possible reasons: (1) The target Firmata may be a different version than we're expecting so it's sending messages in a format we don't understand. (2) The serial port settings used by the application do not match those being used by the connected device. (3) The connected device has a problem and is reporting invalid data. (4) A flaw in this application is improperly parsing a valid message making it appear invalid.

Rhyduino.DigitalPin

Class used to represent and control the state of a digital pin on an Arduino.

Properties

  • Mode Gets the mode of the pin.
  • PinNumber The digital pin number.

Methods

  • #ctor(Rhyduino.Arduino,System.Int32) Constructs an instance of the class.
  • GetPinValue(Rhyduino.DigitalPinValue@)
  • GetPinValue(System.Int16@)
  • GetPinValue(System.Int32@)
  • SetPinMode(Rhyduino.PinMode)
  • SetPinValue(Rhyduino.DigitalPinValue)
  • SetPinValue(System.Int16)
  • SetPinValue(System.Int32)

Events

Rhyduino.DigitalPinEventArgs

Properties

  • DigitalPinValue
  • PinNumber

Methods

  • #ctor(System.Int32,Rhyduino.DigitalPinValue)

Events

Rhyduino.DigitalPins

Class for managing the state of the digital pins.

Properties

  • Item(System.Int32) Gets the pin information for the specified digital pin.

Methods

  • SetPortValue(System.Int32,System.Int32) We use this internally to set the value of the pins when we get a port report from the Arduino. If we get a report from a pin that's not in input mode then we log the incident but don't change the value internally.

Events

Rhyduino.DigitalPinValue

The valid value states for a digital pin.

Properties

Methods

Events

Rhyduino.Extensions

Class containing the extension methods used by the application.

Properties

Methods

  • ToHexString(System.Byte[]) Formats a byte array into an easily readable string for debugging purposes.
  • ToTwo7BitBytes(System.Int32) Takes an integer value and formats it as two 7-bit bytes for sending as part of a Firmata message.
  • Trim(System.Byte[]) Removes trailing null bytes from

Events

Rhyduino.FirmataEncoder

This is a utility class that is used to encode messages as Firmata requests.

Properties

Methods

  • BuildAnalogWriteRequest(System.Int32,System.Int32) Generates a byte array containing the encoded data that represents a request to write a value to an analog pin.
  • BuildDigitalWriteRequest(System.Int32,System.Int32) Generates a byte array containing the encoded data that represents a request to write a value to an analog pin.
  • BuildProtocolVersionRequest Generates a byte array containing the encoded data that represents a request to have the target hardware report which Firmata protocol version it is using.
  • BuildReportAnalogPinRequest(System.Int32,System.Boolean) Generates a byte array containing the encoded data that represents a request to change the monitoring state of an analog pin.
  • BuildReportDigitalPortRequest(System.Int32,System.Boolean) Generates a byte array containing the encoded data that represents a request to change the monitoring state of a digital port.
  • BuildServoConfigRequest(System.Int32,System.Int32,System.Int32,System.Int32) Generates a byte array containing the encoded data that represents a request to configure a pin previously configured as a servo pin.
  • BuildServoPositionRequest(System.Int32,System.Int32) Generates a byte array containing the encoded data that represents a request to move a servo to a specified position.
  • BuildSetPinModeRequest(System.Int32,Rhyduino.PinMode) Generates a byte array containing the encoded data that represents a request to set the I/O mode for the specified digital pin.
  • BuildSetSamplingIntervalRequest(System.Int32) Generates a byte array containing the encoded data that represents a request to set the sampling rate for the Firmata sketch running on the target hardware. The sampling rate is how frequently the target hardware polls for data updates.
  • BuildSystemResetRequest Generates a byte array containing the encoded data that represents a request to reset the stored state on the target device. This does not request a hard reset of the target hardware

Events

Rhyduino.FirmataEventArgs`1

Class used to encapsulate Firmata message data.

Properties

  • Data The message payload.

Methods

  • #ctor(`0) Creates and initializes a new instance of the class.

Events

Rhyduino.Message.AnalogPinReport

Class containing the data contained in an encoded Firmata analog pin report message.

Properties

  • Pin The pin being reported.
  • Value The value of the reported pin.

Methods

  • #ctor(System.Byte[]) Creates and initializes an AnalogPinReport object from an encoded Firmata analog pin report message.
  • ToString Converts the object to a meaningful string representation.

Events

Rhyduino.Message.DigitalPortReport

Class containing the data contained in an encoded Firmata digital port report message.

Properties

  • Port The port being reported.
  • Value The value of the reported port.

Methods

  • #ctor(System.Byte[]) Creates and initializes a DigitalPortReport object from an encoded Firmata digital port report message.
  • ToString Converts the object to a meaninful string representation.

Events

Rhyduino.Message.FirmataMessage

Class containing the raw encoded data from a Firmata message.

Properties

Methods

  • #ctor(System.Byte[]) Creates and initializes a FirmataMessage object from an encoded Firmata message. No decoding is performed.
  • GetRawMessage Gets the raw (encoded) bytes contained in the message.

Events

Rhyduino.Message.FirmataVersionReport

Class containing the data contained in an encoded Firmata version report message.

Properties

  • MajorVersion The major version component of the message.
  • MinorVersion The minor version component of the message.
  • Name The name of the Firmata sketch reported.

Methods

  • #ctor(System.Byte[]) Creates and initializes a FirmataVersionReport object from an encoded Firmata version report message.
  • ToString Returns a string describing the object.

Events

Rhyduino.PinMode

The valid I/O states for digital pins.

Properties

Methods

Events

Rhyduino.RequestMessageType

The values defining the different types of request messages.

Properties

Methods

Events

Rhyduino.ResponseMessageType

The values defining the different types of response messages.

Properties

Methods

Events

Rhyduino.SerialListener

This class listens on the provided serial port and broadcasts the decoded messages it receives. It makes no attempts to open or close the port.

Properties

Methods

Events

Last edited Jul 4, 2010 at 10:00 PM by RhyMednick, version 6

Comments

No comments yet.