C# 클래스 Emlid.WindowsIot.Hardware.Boards.Navio.NavioLedPwmDevice

Navio LED & PWM servo driver (PCA9685 hardware device), connected via I2C.
Navio uses the NxpPca9685Device as a dual-purpose PWM and LED driver, i.e. for servo control and the high intensity RGB status LED. It is connected via the I2C bus. See http://docs.emlid.com/Navio-dev/servo-and-rgb-led/ for more information. NxpPca9685Device
상속: Emlid.WindowsIot.Hardware.Components.NxpPca9685.NxpPca9685Device
파일 보기 프로젝트 열기: emlid/Navio-SDK-Windows-IoT 1 사용 예제들

공개 메소드들

메소드 설명
Initialize ( float frequency, bool clear = true, bool restart = true, bool enable = false ) : NavioLedPwmDevice

Creates an initialized instance.

ReadAll ( ) : void

Reads all values from the device and updates properties.

Restart ( NxpPca9685Mode1Bits options ) : void

Restarts the device with additional options specified, then updates all properties.

SetLed ( int red, int green, int blue ) : void

Sets RGB values of the high intensity LED together (in one operation).

Automatically inverts the value, providing a natural behaviour where a higher number produces a higher LED intensity. Normally, when written as raw PWM values, the output is inverted due to common anode.

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

Frees resources owned by this instance.

비공개 메소드들

메소드 설명
NavioLedPwmDevice ( Windows.Devices.I2c.I2cDevice device ) : System
OnLedBlueChannelChanged ( object sender, EventArgs arguments ) : void

Updates the LedBlue property when the related channel changed.

OnLedGreenChannelChanged ( object sender, EventArgs arguments ) : void

Updates the LedGreen property when the related channel changed.

OnLedRedChannelChanged ( object sender, EventArgs arguments ) : void

Updates the LedRed property when the related channel changed.

ReadLed ( ) : void

Reads the LED channels from the device, calculates then updates the related properties.

메소드 상세

Dispose() 보호된 메소드

Frees resources owned by this instance.
protected Dispose ( bool disposing ) : void
disposing bool /// True when called via , false when called from the finalizer. ///
리턴 void

Initialize() 공개 정적인 메소드

Creates an initialized instance.
public static Initialize ( float frequency, bool clear = true, bool restart = true, bool enable = false ) : NavioLedPwmDevice
frequency float /// for important information. /// Use to support most analog servos. ///
clear bool Clears all LED/PWM values.
restart bool /// Set true to restart the device which also enables the osciallator. /// When false, you have to call or later to enable the oscillator. ///
enable bool /// Set true to enable output, or false to continue with further initialization before enabling output. /// When false, you have to set it later before any output can occur. /// Defaults to false to prevent unexpected behaviour from damaging hardware. ///
리턴 NavioLedPwmDevice

ReadAll() 공개 메소드

Reads all values from the device and updates properties.
public ReadAll ( ) : void
리턴 void

Restart() 공개 메소드

Restarts the device with additional options specified, then updates all properties.
public Restart ( NxpPca9685Mode1Bits options ) : void
options NxpPca9685Mode1Bits /// Optional mode 1 parameters to add to the final restart sequence. A logical OR is applied to this value and /// the standard , , /// and bits. ///
리턴 void

SetLed() 공개 메소드

Sets RGB values of the high intensity LED together (in one operation).
Automatically inverts the value, providing a natural behaviour where a higher number produces a higher LED intensity. Normally, when written as raw PWM values, the output is inverted due to common anode.
public SetLed ( int red, int green, int blue ) : void
red int Red value in the range 0-.
green int Green value in the range 0-.
blue int Blue value in the range 0-.
리턴 void