Nuget Package for thread-safe communication between Raspberry Pi & Arduino in Windows 10 IoT Core UWPs
Install-Package RpiUno -Version 1.0.0
dotnet add package RpiUno --version 1.0.0
The Package currently supports communication over I2C bus.
Include using RpiUno;
where you need to use the package.
The package classifies Arduino operations into three modes:
RecieveSensorData
: Sends a byte '0' to arduino to indicate operation to receive sensor data.RecieveDeviceState
: Sends a byte '1' to arduino to indicate operation to receive a Pin's stateSendIOSignal
: Sends a byte '2' to arduino to indicate operation to turn a pinHIGH
orLOW
Make an asynchronus call to ReadWriteAsync()
method to perform a read or write operation on Arduino.
await UnoI2C.ReadWriteAsync("Mention slave address (int)", Mode.SendIOSignal, (Pin Number as byte), PinValue.High);
await UnoI2C.ReadWriteAsync(Mention slave address (int), Mode.RecieveSensorData, (Sensor Pin Number as byte));
await UnoI2C.ReadWriteAsync(Mention slave address (int), Mode.RecieveDeviceState, (Sensor Pin Number as byte));