C# Класс GHIElectronics.UAP.Shields.FEZHAT

A helper class for the FEZ HAT.
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
CreateAsync ( ) : Task

Creates a new instance of the FEZ HAT.

Dispose ( ) : void

Disposes of the object releasing control the pins.

GetAcceleration ( double &x, double &y, double &z ) : void

Gets the acceleration in G's for each axis from the onboard sensor.

GetLightLevel ( ) : double

Gets the light level from the onboard sensor.

GetTemperature ( ) : double

Gets the temperature in celsius from the onboard sensor.

IsDIO18Pressed ( ) : bool

Whether or not the button labeled DIO18 is pressed.

IsDIO22Pressed ( ) : bool

Whether or not the button labeled DIO18 is pressed.

ReadAnalog ( AnalogPin pin ) : double

Reads the current voltage on the given pin.

ReadDigital ( DigitalPin pin ) : bool

Reads the current state of the given pin.

SetPwmDutyCycle ( PwmPin pin, double value ) : void

Sets the duty cycle of the given pwm pin.

WriteDigital ( DigitalPin pin, bool state ) : void

Write the given value to the given pin.

Защищенные методы

Метод Описание
Dispose ( bool disposing ) : void

Disposes of the object releasing control the pins.

Приватные методы

Метод Описание
FEZHAT ( ) : GHIElectronics.UAP.Drivers

Описание методов

CreateAsync() публичный статический Метод

Creates a new instance of the FEZ HAT.
public static CreateAsync ( ) : Task
Результат Task

Dispose() публичный Метод

Disposes of the object releasing control the pins.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

Disposes of the object releasing control the pins.
protected Dispose ( bool disposing ) : void
disposing bool Whether or not this method is called from Dispose().
Результат void

GetAcceleration() публичный Метод

Gets the acceleration in G's for each axis from the onboard sensor.
public GetAcceleration ( double &x, double &y, double &z ) : void
x double The current X-axis acceleration.
y double The current Y-axis acceleration.
z double The current Z-axis acceleration.
Результат void

GetLightLevel() публичный Метод

Gets the light level from the onboard sensor.
public GetLightLevel ( ) : double
Результат double

GetTemperature() публичный Метод

Gets the temperature in celsius from the onboard sensor.
public GetTemperature ( ) : double
Результат double

IsDIO18Pressed() публичный Метод

Whether or not the button labeled DIO18 is pressed.
public IsDIO18Pressed ( ) : bool
Результат bool

IsDIO22Pressed() публичный Метод

Whether or not the button labeled DIO18 is pressed.
public IsDIO22Pressed ( ) : bool
Результат bool

ReadAnalog() публичный Метод

Reads the current voltage on the given pin.
public ReadAnalog ( AnalogPin pin ) : double
pin AnalogPin The pin to read.
Результат double

ReadDigital() публичный Метод

Reads the current state of the given pin.
public ReadDigital ( DigitalPin pin ) : bool
pin DigitalPin The pin to read.
Результат bool

SetPwmDutyCycle() публичный Метод

Sets the duty cycle of the given pwm pin.
public SetPwmDutyCycle ( PwmPin pin, double value ) : void
pin PwmPin The pin to set the duty cycle for.
value double The new duty cycle between 0 (off) and 1 (on).
Результат void

WriteDigital() публичный Метод

Write the given value to the given pin.
public WriteDigital ( DigitalPin pin, bool state ) : void
pin DigitalPin The pin to set.
state bool The new state of the pin.
Результат void