Name | Description |
---|---|
pin |
int to initialize |
mode |
PinMode PinMode to init pin |
void Setup() {
UduinoManager.Instance.pinMode(9, PinMode.Output);
}
Name | Description |
---|---|
pin |
AnalogPin Analog pin to initialize |
mode |
PinMode PinMode to init pin |
void Setup() {
UduinoManager.Instance.pinMode(AnalogPin.A0, PinMode.Input);
}
Name | Description |
---|---|
target |
UduinoDevice Target object |
pin |
AnalogPin to init |
mode |
PinMode PinMode to init pin |
void Setup() {
UduinoManager.Instance.OnBoardConnected += OnBoardConnected;
}
void OnBoardConnected(UduinoDevice connectedDevice)
{
if (connectedDevice.name == "uduinoBoard") {
UduinoManager.Instance.pinMode(connectedDevice, 9, PinMode.Servo);
}
else if (connectedDevice.name == "otherBoard") {
UduinoManager.Instance.pinMode(connectedDevice, AnalogPin.10, PinMode.Input);
}
}
Name | Description |
---|---|
target |
UduinoDevice Target object |
pin |
int to init |
mode |
PinMode PinMode to init pin |
void Setup() {
UduinoManager.Instance.OnBoardConnected += OnBoardConnected;
}
void OnBoardConnected(UduinoDevice connectedDevice)
{
if (connectedDevice.name == "uduinoBoard") {
UduinoManager.Instance.pinMode(connectedDevice, 9, PinMode.Servo);
}
else if (connectedDevice.name == "otherBoard") {
UduinoManager.Instance.pinMode(connectedDevice, AnalogPin.10, PinMode.Input);
}
}
Name | Description |
---|---|
command |
string Command Name |
value |
object[] List of any parameters. This object is later cast as string |
void Update() {
UduinoManager.Instance.sendCommand("turnLED", "on"); //or "off"
UduinoManager.Instance.sendCommand("setBrightness", 20, 150, 255);
}
Name | Description |
---|---|
command |
string Command Name |
target |
string Command Name |
value |
object[] List of any parameters. This object is later cast as string |
void Update() {
UduinoDevice board = UduinoManager.Instance.GetBaord("uduinoBoardName");
UduinoManager.Instance.sendCommand(board, "turnLED", "on"); //or "off"
UduinoManager.Instance.sendCommand(board, "setBrightness", 20, 150, 255);
}
Name | Description |
---|---|
target |
UduinoDevice Target device |
message |
string Message to write, including command and parameters |
bundle |
string Optional bundle name |
void Update() {
string message = UduinoManager.BuildMessageParameters(10, "on", 255, "off");
UduinoManager.Instance.sendCommand("setBrightness", message);
}
Name | Description |
---|---|
pin |
int Target Pin |
void Start() {
UduinoManager.Instance.pinMode(9, PinMode.Output);
}
void Update() {
UduinoManager.Instance.digitalWrite(9, 150);
}
Name | Description |
---|---|
pin |
int Target Pin |
void Start() {
UduinoManager.Instance.pinMode(13, PinMode.Output);
}
void Update() {
UduinoManager.Instance.digitalWrite(13, PinMode.HIGH);
}
Name | Description |
---|---|
target |
UduinoDevice Target board |
pin |
int Target Pin |
value |
int Value to send, either 0 or 255 [high or low] |
bundle |
string Optional Bundle |
void Update() {
UduinoDevice board = UduinoManager.Instance.GetBaord("uduinoBoard");
UduinoManager.Instance.digitalWrite(board, 9, 255);
}
Name | Description |
---|---|
target |
UduinoDevice Target board |
void Update() {
UduinoDevice board = UduinoManager.Instance.GetBaord("uduinoBoard");
UduinoManager.Instance.digitalWrite(board, 13, PinMode.LOW);
}
Name | Description |
---|---|
pin |
int Target Pin |
Name | Description |
---|
void Start() {
UduinoManager.Instance.pinMode(13, PinMode.Input_Pullup);
}
void Update() {
int buttonValue = UduinoManager.Instance.digitalRead(13);
Debug.Log(buttonValue);
}
Name | Description |
---|---|
target |
UduinoDevice Target board |
Name | Description |
---|
void Start() {
UduinoManager.Instance.pinMode(4, PinMode.Input_Pullup);
}
void Update() {
UduinoDevice board = UduinoManager.Instance.GetBaord("uduinoBoard");
int buttonValue = UduinoManager.Instance.digitalRead(board, 4);
Debug.Log(buttonValue);
}
Name | Description |
---|---|
pin |
int Pin to write |
value |
int Value from 0 to 255 |
bundle |
string Optional Bundle |
void Start() {
UduinoManager.Instance.pinMode(6, PinMode.Output);
}
void Update() {
UduinoManager.Instance.analogWrite(6, 145);
}
Name | Description |
---|---|
target |
UduinoDevice Target board |
pin |
int Pin to write |
value |
int Value from 0 to 255 |
bundle |
string Optional Bundle |
void Start() {
UduinoManager.Instance.pinMode(6, PinMode.Output);
}
void Update() {
UduinoDevice board = UduinoManager.Instance.GetBaord("uduinoBoard");
UduinoManager.Instance.analogWrite(board, 6, 79);
}
Name | Description |
---|---|
pin |
AnalogPin Analog pin to read |
bundle |
string Optional Bundle |
Name | Description |
---|
void Start() {
UduinoManager.Instance.pinMode(AnalogPin.A0, PinMode.Input);
}
void Update() {
int value = UduinoManager.Instance.analogRead(AnalogPin.A0);
Debug.Log(value);
}
Name | Description |
---|---|
pin |
int Pin to read, as int. See the pinout of your board. |
bundle |
string Optional Bundle |
Name | Description |
---|
void Start() {
UduinoManager.Instance.pinMode(18, PinMode.Input); // In arduino uno, pin 18 is the pin A4
}
void Update() {
int value = UduinoManager.Instance.analogRead(18);
Debug.Log(value);
}
Name | Description |
---|---|
target |
UduinoDevice Target board |
pin |
AnalogPin Pin to read |
bundle |
string Optional Bundle |
Name | Description |
---|
void Start() {
UduinoManager.Instance.pinMode(AnalogPin.A0, PinMode.Input); // In arduino uno, pin 18 is the pin A4
}
void Update() {
UduinoDevice board = UduinoManager.Instance.GetBaord("uduinoBoardName");
int value = UduinoManager.Instance.analogRead(board, AnalogPin.A0);
Debug.Log(value);
}
Name | Description |
---|---|
target |
UduinoDevice Target board |
pin |
int Pin to read |
bundle |
string Optional Bundle |
Name | Description |
---|
void Start() {
UduinoManager.Instance.pinMode(18, PinMode.Input); // In arduino uno, pin 18 is the pin A4
}
void Update() {
UduinoDevice board = UduinoManager.Instance.GetBaord("uduinoBoardName");
int value = UduinoManager.Instance.analogRead(board, 18);
Debug.Log(value);
}
Name | Description |
---|---|
target |
UduinoDevice Uduino Device |
bundleName |
string Bundle name |
void Update() {
UduinoDevice board = UduinoManager.Instance.GetBaord("uduinoBoardName");
UduinoManager.Instance.SendBundle(board, "bundleName");
}
Name | Description |
---|---|
parameters |
object[] List of a variable number of parameters |
Name | Description |
---|
void Update() {
string message = UduinoManager.BuildMessageParameters(10, "on", 255, "off");
UduinoManager.Instance.sendCommand("setBrightness", message);
}
Name | Description |
---|---|
bundleName |
string Bundle name |
void Update() {
UduinoManager.Instance.SendBundle("bundleName");
}
Name | Description |
---|---|
Board Type |
Type of Board Arduino Uno, Arduino Duemilanove, Arduino Leonardo, Arduino Pro Mini,Arduino Mega, Arduino Due, Arduino Nano, Arduino Mini |
void Setup() {
UduinoManager.Instance.SetBoardType("Arduino Mega");
customPinAnalog = UduinoManager.Instance.GetPinNumberFromBoardType("Arduino Mega", 52);
UduinoManager.Instance.pinMode(customPinAnalog, PinMode.Output);
}
Name | Description |
---|---|
target |
UduinoDevice Target Arduino Board |
Board Type |
Type of board Arduino Uno, Arduino Duemilanove, Arduino Leonardo, Arduino Pro Mini,Arduino Mega, Arduino Due, Arduino Nano, Arduino Mini |
void Setup() {
UduinoManager.Instance.OnBoardConnected += OnBoardConnected;
}
void OnBoardConnected(UduinoDevice connectedDevice)
{
if (connectedDevice.name == "uduinoBoard") {
UduinoManager.Instance.SetBoardType(connectedDevice, "Arduino Mega");
} else if (connectedDevice.name == "otherBoard") {
UduinoManager.Instance.SetBoardType(connectedDevice, "Arduino Uno");
}
}
Name | Description |
---|---|
boardType |
string Type of Arduino board |
pin |
string Pin to find (Digital or Analog |
Name | Description |
---|---|
Arduino pin |
int The id of the arduino pin of this board |
void Setup() {
UduinoManager.Instance.SetBoardType("Arduino Mega");
customPinAnalog = UduinoManager.Instance.GetPinNumberFromBoardType("Arduino Mega", "A14");
UduinoManager.Instance.pinMode(customPinAnalog, PinMode.Input);
}
Name | Description |
---|---|
boardType |
string Type of Arduino board |
pin |
int Pin to find (Digital |
Name | Description |
---|---|
Arduino pin |
int The id of the arduino pin of this board |
void Setup() {
UduinoManager.Instance.SetBoardType("Arduino Mega");
customPinAnalog = UduinoManager.Instance.GetPinNumberFromBoardType("Arduino Mega", 52);
UduinoManager.Instance.pinMode(customPinAnalog, PinMode.Output);
}
Name | Description |
---|---|
callback |
Action Callback function |
Name | Description |
---|---|
callback |
Action Callback function |
void Start() {
UduinoManager.Instance.SetReadCallback(ValueReceived);
}
void ValueReceived(string value) {
Debug.Log(value);
}
Name | Description |
---|---|
target |
UduinoDevice Target device |
void Setup() {
UduinoManager.Instance.OnBoardConnected += OnBoardConnected;
}
void OnBoardConnected(UduinoDevice connectedDevice)
{
if (connectedDevice.name == "uduinoBoard") {
UduinoManager.Instance.SetReadCallback(connectedDevice, ValueReceivedBoardOne);
}
else if (connectedDevice.name == "otherBoard") {
UduinoManager.Instance.pinMode(connectedDevice, ValueReceivedBoardTwo);
}
}
void ValueReceivedBoardOne(string value) {
Debug.Log(value);
}
void ValueReceivedBoardTwo(string value) {
Debug.Log(value);
}
These functions were present in Uduino 1.4.3
but have been deprecated in Uduino 2.0.0+
Name | Description |
---|---|
pin |
int to initialize |
mode |
PinMode PinMode to init pin |
Name | Description |
---|---|
pin |
AnalogPin Analog pin to initialize |
mode |
PinMode PinMode to init pin |
Name | Description |
---|---|
target |
string Target Name |
pin |
AnalogPin to init |
mode |
PinMode PinMode to init pin |
Name | Description |
---|---|
target |
string Target Name |
pin |
int to init |
mode |
PinMode PinMode to init pin |
Name | Description |
---|---|
target |
string Target device name. Not defined means read everything |
message |
string Variable watched, if defined |
timeout |
int Read Timeout, if defined |
action |
Action Action callback |
Name | Description |
---|---|
target |
string Target device |
message |
string Message to write in the serial |
Name | Description |
---|---|
target |
string Target device |
message |
string Message to write in the serial |
value |
int Optional value |
Name | Description |
---|---|
name |
int desc |