C# 클래스 CyrusBuilt.MonoPi.Components.Servos.RPIServoBlasterProvider

A GPIO provider for servos driven via ServoBlaster. This is an implementation of Implementation of https://github.com/richardghirst/PiBits/tree/master/ServoBlaster
상속: IServoProvider
파일 보기 프로젝트 열기: cyrusbuilt/MonoPi 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
PIN_MAP String>.Dictionary
REVERSE_PIN_MAP IRaspiGpio>.Dictionary

공개 메소드들

메소드 설명
Dispose ( ) : void

Releases all resource used by the CyrusBuilt.MonoPi.Components.Servos.RPIServoBlasterProvider object.

Call Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Servos.RPIServoBlasterProvider. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Servos.RPIServoBlasterProvider in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Servos.RPIServoBlasterProvider so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Servos.RPIServoBlasterProvider was occupying.

GetServoDriver ( IPin servoPin ) : IServoDriver

Gets a driver for the requested pin.

UpdateServo ( String pinName, Int32 value ) : void

Updates the servo by writing the specified value to the specified pin.

보호된 메소드들

메소드 설명
EnsureWriterIsCreated ( ) : void

Ensures the writer is created.

OnUnrecognizedPinFound ( UnrecognizedPinFoundEventArgs e ) : void

Raises the unrecognized pin found event.

비공개 메소드들

메소드 설명
DefinePin ( IRaspiGpio pin, String name ) : void

Helper method for adding pins to the pin maps.

GetServoPinsFromConfig ( ) : List

Gets a list of servo pins from the config and validates them against the pin map.

RPIServoBlasterProvider ( ) : System

Initializes the CyrusBuilt.MonoPi.Components.Servos.RPIServoBlasterProvider class. This is a static initializer to populate the pin maps (which are also static). This initializer will only be called *ONCE* before any static members are referenced and will not be called again during the lifetime of the application domain. As such, it is NOT advisable to dispose of the pin maps (clear the dictionaries and/or set null) unless you know what you are doing as they are only initialized once.

메소드 상세

Dispose() 공개 메소드

Releases all resource used by the CyrusBuilt.MonoPi.Components.Servos.RPIServoBlasterProvider object.
Call Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Servos.RPIServoBlasterProvider. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Servos.RPIServoBlasterProvider in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Servos.RPIServoBlasterProvider so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Servos.RPIServoBlasterProvider was occupying.
public Dispose ( ) : void
리턴 void

EnsureWriterIsCreated() 보호된 메소드

Ensures the writer is created.
protected EnsureWriterIsCreated ( ) : void
리턴 void

GetServoDriver() 공개 메소드

Gets a driver for the requested pin.
/// The specified servo pin is not a defined servo pin. /// /// No driver is assigned to the specified pin - or - Cannot drive servo /// from specified pin - or - another initialization error occurred. ///
public GetServoDriver ( IPin servoPin ) : IServoDriver
servoPin IPin /// The pin the driver is needed for. ///
리턴 IServoDriver

OnUnrecognizedPinFound() 보호된 메소드

Raises the unrecognized pin found event.
protected OnUnrecognizedPinFound ( UnrecognizedPinFoundEventArgs e ) : void
e CyrusBuilt.MonoPi.IO.UnrecognizedPinFoundEventArgs /// The event arguments. ///
리턴 void

UpdateServo() 공개 메소드

Updates the servo by writing the specified value to the specified pin.
/// Unable to write to the ServoBlaster device. ///
public UpdateServo ( String pinName, Int32 value ) : void
pinName String /// The name of the pin to write to. ///
value System.Int32 /// The value to write to the pin. ///
리턴 void

프로퍼티 상세

PIN_MAP 공개적으로 정적으로 프로퍼티

A pin map. Maps pin GPIO pins to pin names.
public static Dictionary PIN_MAP
리턴 String>.Dictionary

REVERSE_PIN_MAP 공개적으로 정적으로 프로퍼티

A reverse-order pin map. Maps pin names to GPIO pins.
public static Dictionary REVERSE_PIN_MAP
리턴 IRaspiGpio>.Dictionary