ArduinoBoard Class

Definition

Implements an interface to an arduino board which is running Firmata. See documentation on how to prepare your arduino board to work with this. Note that the program will run on the PC, so you cannot disconnect the Arduino while this driver is connected.

public class ArduinoBoard : IDisposable
public class ArduinoBoard : Iot.Device.Board.Board, IDisposable
type ArduinoBoard = class
    interface IDisposable
type ArduinoBoard = class
    inherit Board
    interface IDisposable
Public Class ArduinoBoard
Implements IDisposable
Public Class ArduinoBoard
Inherits Board
Implements IDisposable
Inheritance
ArduinoBoard
Inheritance
ArduinoBoard
Implements

Constructors

ArduinoBoard(Stream)

Creates an instance of an Ardino board connection using the given stream (typically from a serial port)

ArduinoBoard(Stream, Boolean)

Creates an instance of an Ardino board connection using the given stream (typically from a serial port)

ArduinoBoard(String, Int32)

Creates an instance of the Arduino board connection connected to a serial port

Properties

DefaultPinNumberingScheme

The default pin numbering scheme for this board.

(Inherited from Board)
Disposed

True if this instance is disposed. Any attempt to use it after this becomes true results in undefined behavior.

(Inherited from Board)
FirmataVersion

Firmata version found on the board.

FirmwareName

Name of the firmware.

FirmwareVersion

Firmware version on the device

Initialized

True if the board instance is initialized

(Inherited from Board)
KnownModes

The list of supported pin modes. This list can be extended by adding special modes using AddCommandHandler<T>(T).

Logger

The board logger.

StreamUsesHardwareFlowControl

Set this to true if the underlying stream uses some kind of hardware or low-level flow control (RTS/CTS for a serial port, or a TCP socket). Setting this to true may improve performance on bulk transfers (such as large SPI blocks) but can result in buffer overflows if flow control is not working. Default: false

SupportedPinConfigurations

Returns the list of capabilities per pin

Methods

ActivatePinMode(Int32, PinUsage)

Override this method if something special needs to be done to use the pin for the given device. Many devices support multiple functions per Pin, but not at the same time, so that some kind of multiplexer needs to be set accordingly.

(Inherited from Board)
AddCommandHandler<T>(T)

Adds a new command handler. A command handler can support extended commands.

CommonBaudRates()

Returns a list of commonly used baud rates.

CreateAnalogController(Int32)

Creates an anlog controller for this board.

CreateGpioController()

Creates a GPIO Controller instance for the board. This allows working with digital input/output pins.

CreateI2cBusCore(Int32, Int32[])

Create an instance of an I2C bus in a derived class

CreateI2cDevice(I2cConnectionSettings)
CreateI2cDevice(I2cConnectionSettings)

Create an I2C device instance on a default bus.

(Inherited from Board)
CreateOrGetI2cBus(Int32)

Create an I2C bus instance or return the existing instance for this bus

(Inherited from Board)
CreateOrGetI2cBus(Int32, Int32[])

Create an I2C bus instance or return the existing instance for this bus

(Inherited from Board)
CreatePwmChannel(Int32, Int32, Int32, Double)
CreatePwmChannel(Int32, Int32, Int32, Double)

Creates a PWM channel for the default pin assignment

(Inherited from Board)
CreatePwmChannel(Int32, Int32, Int32, Double, Int32, PinNumberingScheme)

Creates a PWM channel

(Inherited from Board)
CreateSimplePwmChannel(Int32, Int32, Int32, Double)

Creates a PWM channel.

CreateSimpleSpiDevice(SpiConnectionSettings, Int32[])

Connect to a device connected to the primary SPI bus on the Arduino Firmata's default implementation has no SPI support, so this first checks whether it's available at all.

CreateSpiDevice(SpiConnectionSettings)
CreateSpiDevice(SpiConnectionSettings)

Create an SPI device instance

(Inherited from Board)
CreateSpiDevice(SpiConnectionSettings, Int32[], PinNumberingScheme)

Create an SPI device instance

(Inherited from Board)
DetermineCurrentPinUsage(Int32)

Returns the current assignment of the given pin

Dispose()
Dispose() (Inherited from Board)
Dispose(Boolean)

Standard dispose pattern

GetCommandHandler<T>()

Gets the command handler with the provided type. An exact type match is performed.

GetDefaultI2cBusNumber()

Creates the default I2C bus for this board or returns the existing bus

GetDefaultPinAssignmentForI2c(Int32)

Overriden by derived classes: Provides the default pin assignment for the given I2C bus

GetDefaultPinAssignmentForPwm(Int32, Int32)

Overriden by derived class. Provides the default pin for a given channel.

GetDefaultPinAssignmentForSpi(SpiConnectionSettings)

Overriden by derived classes: Provides the default pin assignment for the given SPI bus

GetPinMode(Int32)

Returns the current assignment of the given pin

GetSystemVariable(SystemVariable, Int32)

Queries the given system variable.

GetSystemVariable(SystemVariable, Int32, Int32)

Queries the given system variable.

Initialize()

Initialize the board connection. This must be called before any other methods of this class.

Ping(Int32)

Pings the device, to get an estimate about the round-trip time. With some Wifi setups, the round trip time may be significantly higher than desired.

QueryComponentInformation() System.Object.QueryComponentInformation
QueryComponentInformation()

Query information about a component and its children.

(Inherited from Board)
ReleasePin(Int32, PinUsage, Object)

Removes the reservation for a pin. See ReservePin(Int32, PinUsage, Object) for details.

(Inherited from Board)
ReservePin(Int32, PinUsage, Object)

Reserves a pin for a specific usage. This is done automatically if a known interface (i.e. GpioController) is used to open the pin, but may be used to block a pin explicitly, i.e. for UART.

(Inherited from Board)
SetAnalogPinSamplingInterval(TimeSpan)

Configures the sampling interval for analog input pins (when an event callback is enabled)

SetPinMode(Int32, SupportedMode)

Sets the internal pin mode to the given value, if supported.

SetSystemVariable(SystemVariable, Int32)

Update the given system variable.

SetSystemVariable(SystemVariable, Int32, Int32)

Update the given system variable.

SoftwareReset()

Performs a software reset of the Arduino firmware

TryConnectToNetworkedBoard(IPAddress, Int32, ArduinoBoard)

Tries to connect to an arduino over network. This requires an arduino with an ethernet shield or an ESP32 with enabled WIFI support.

TryConnectToNetworkedBoard(IPAddress, Int32, Boolean, ArduinoBoard)

Tries to connect to an arduino over network. This requires an arduino with an ethernet shield or an ESP32 with enabled WIFI support.

TryCreateBestGpioDriver()

Tries to create the best possible GPIO driver for this hardware.

(Inherited from Board)
TryFindBoard(ArduinoBoard)

Searches all available com ports for an Arduino device.

TryFindBoard(IEnumerable<String>, IEnumerable<Int32>, ArduinoBoard)

Searches the given list of com ports for a firmata device.

TryReadDht(Int32, Int32, Temperature, RelativeHumidity)

Special function to read DHT sensor, if supported

Events

LogMessages

Applies to