RobotIO Class

The main class through which input and output operations are performed with devices and components connected to the Arduino.

Definition

Namespace: RoboTx.Api
Assembly: RoboTx.Api (in RoboTx.Api.dll) Version: 2.0.0
C#
public class RobotIO : IDisposable
Inheritance
Object    RobotIO
Implements
IDisposable

Constructors

RobotIO(String) Constructs an instance using a serial port name, 115200 baud rate and data terminal ready as true.
RobotIO(String, Int32, Boolean) Constructs an instance using a serial port name, baud rate and data terminal ready settings.

Properties

Analog Allows for configuring of analog input, and exposing analog readings.
ColourSensor Reports values read using TCS34725 sensor. This feature is only available in the Education Edition of the RoboTx API.
ConnectionState Informs the connected state of the computer with the Arduino.
DHTSensor Reports temperature and humidity values using a DHT20 sensor. This feature is only available in the Education Edition of the RoboTx API.
Digital Exposes digital input readings.
Display Sends text output to the LCD display.
LedDisplay Writes a string to the 7 segment LED display.
LightMeter Reports values using the BH1750 light meter sensor. This feature is only available in the Education Edition of the RoboTx API.
Motor1 Controls speed and direction of motor 1.
Motor2 Controls speed and direction of motor 2.
MotorConfig Configuration options for DC motors.
MPUSensor Reports accelerometer and gyrometer readings from an MPU6050 sensor. This feature is only available in the Education Edition of the RoboTx API.
PulseCounter Calculates period of input pulses on a designated Arduino pin. This feature is only available in the Education Edition of the RoboTx API.
RobotId Gets the user defined ROBOT_ID string set in the firmware file Settings.h. Use the value of this property to distinguish between different robots connected at the same time.
Servo1 Sets the range and position of servo motor 1.
Servo2 Sets the range and position of servo motor 2.
Servo3 Sets the range and position of servo motor 3.
Servo4 Sets the range and position of servo motor 4.
ServoConfig Configuration options for servo motors.
Sonar Uses sonar to calculate distance by sending a ping and measuring the time lapsed before receiving the echo.
Switch1 Sets a digital output to on or off.
Switch2 Sets a digital output to on or off.
Switch3 Sets a digital output to on or off.
Switch4 Sets a digital output to on or off.
Trigger A digital trigger for generating repeating pulse cycle patterns.

Methods

Close Closes connection with Arduino. DC motors and servo motors will be disabled, the digital trigger and digital switches will turn off, and the LED display will clear.
Connect Initiates serial connection with Arduino using port and baud rates specified in constructor.
Dispose Closes connection with the Arduino and releases resources.
Dispose(Boolean) Closes connection with the Arduino and releases resources.
NotifyClosing The method should be called in the main application to signal to background threads monitoring property IsClosing that they should terminate gracefully.
WaitUntilSensorsReady(ContinuousSensor) Waits up to 2000ms for specified sensors to become ready. The sensors must have been enabled beforehand. Analog sensors are enabled by default.
WaitUntilSensorsReady(Int32, ContinuousSensor) Waits up to the timeout period for specified sensors to become ready. The sensors must have been enabled beforehand. Analog sensors are enabled by default.

See Also