Table of Contents

Class ServoOutput

Namespace
Bonsai.Arduino
Assembly
Bonsai.Arduino.dll

Represents an operator that writes a sequence of angular positions to control a servomotor connected to an Arduino output pin.

public class ServoOutput : Sink<int>
Inheritance
ServoOutput
Inherited Members

Properties

Pin

Gets or sets the digital output pin number to which the servo is connected.

public int Pin { get; set; }

Property Value

int

PortName

Gets or sets the name of the serial port used to communicate with the Arduino.

[TypeConverter(typeof(PortNameConverter))]
public string PortName { get; set; }

Property Value

string

Methods

Process(IObservable<int>)

Writes a sequence of angular position values to control a servomotor connected to the specified Arduino output pin.

public override IObservable<int> Process(IObservable<int> source)

Parameters

source IObservable<int>

A sequence of int values specifying angular positions, in degrees from 0 to 180, used to control the servomotor connected to the specified Arduino output pin.

Returns

IObservable<int>

A sequence of int values containing the angular positions which have been used to control the servomotor connected to the specified Arduino output pin.

Remarks

This operator only subscribes to the source sequence after initializing the connection to the Arduino and configuring the digital pin as a Servo output.