public PushButton(IArduino board, int pin, ITimer timer = null) : base(board, pin, timer) { SetPinMode(PinMode.Input); SetDefaults(); Setup(board, pin); }
public void Setup() { _arduino = A.Fake <IArduino>(); _timer = new FakeTimer(); _led = new LedPwm(_arduino, Pin, _timer); _led.Intensity.ShouldEqual(0); }
/// <param name='operations'> /// Reference to the ArduinoAPI.IArduino. /// </param> /// <param name='token'> /// Required. /// </param> public static string LimparByToken(this IArduino operations, string token) { return(Task.Factory.StartNew((object s) => { return ((IArduino)s).LimparByTokenAsync(token); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
public void Execute(IArduino arduino) { var redLight = new DigitalWriteRequest(1, ArduinoDriver.DigitalValue.Low); var greenLight = new DigitalWriteRequest(2, ArduinoDriver.DigitalValue.Low); arduino.Send(redLight); arduino.Send(greenLight); }
/// <param name='operations'> /// Reference to the ArduinoAPI.IArduino. /// </param> /// <param name='idCliente'> /// Required. /// </param> public static IList <SalaDeReuniao> GetClienteByIdcliente(this IArduino operations, int idCliente) { return(Task.Factory.StartNew((object s) => { return ((IArduino)s).GetClienteByIdclienteAsync(idCliente); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <param name='operations'> /// Reference to the ArduinoAPI.IArduino. /// </param> /// <param name='smtp'> /// Required. /// </param> /// <param name='haspeople'> /// Required. /// </param> public static string PostBySmtpAndHaspeople(this IArduino operations, string smtp, string haspeople) { return(Task.Factory.StartNew((object s) => { return ((IArduino)s).PostBySmtpAndHaspeopleAsync(smtp, haspeople); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
public void Execute(IArduino arduino) { var leftWheel = new DigitalWriteRequest(1, ArduinoDriver.DigitalValue.Low); var rightWheel = new DigitalWriteRequest(2, ArduinoDriver.DigitalValue.Low); arduino.Send(rightWheel); arduino.Send(leftWheel); }
public GestureRecognition() { _list = new List <TimePointF>(); _arduino = new Arduino.Arduino("COM3"); _arduino.TapRecieved += TapRecieved; _arduino.DataRecieved += DetectScrolls; }
public MainWindow() { _points = new List <TimePointF>(); //TODO - Remove comment for real arduino _arduino = new Arduino("COM3"); InitializeComponent(); }
public LedRGB(IArduino board, int[] pins, ITimer timer = null) : base(board, pins, timer) { if (pins.Length != 3) { throw new ArgumentException("Expecting 3 pins", "pins"); } _redPin = pins[0]; _greenPin = pins[1]; _bluePin = pins[2]; SetPinMode(PinMode.Pwm); }
public Arduino() { InitializeComponent(); arduino = DependencyService.Get <IArduino>(); ConnectionMethodPicker.SelectedIndexChanged += ConnectionPickerSelectionChanged; if (Device.RuntimePlatform == Device.UWP) { var def = new ColumnDefinition(); def.Width = GridLength.Star; ButtonGrid.ColumnDefinitions.Add(def); var button = new Button(); button.Text = "Back"; Grid.SetColumn(button, 3); ButtonGrid.Children.Add(button); button.Clicked += BackButtonClicked; } }
private void Setup(IArduino board, int pin) { SetInterval(() => { var isDown = board.DigitalRead(pin) == 1; var wasDown = IsDown; if (!wasDown && isDown) { IsDown = true; Down(); } else if (wasDown && !isDown) { IsDown = false; Up(); } }, 5); }
public async Task Execute(IArduino arduino) { var leftWheelOn = new DigitalWriteRequest(1, ArduinoDriver.DigitalValue.High); var leftWheelOff = new DigitalWriteRequest(1, ArduinoDriver.DigitalValue.Low); var rightWheelOn = new DigitalWriteRequest(2, ArduinoDriver.DigitalValue.High); var rightWheelOff = new DigitalWriteRequest(2, ArduinoDriver.DigitalValue.Low); Task delay = Task.Delay(2000); Task task1 = new Task(async() => { arduino.Send(leftWheelOff); arduino.Send(rightWheelOn); }); Task task2 = new Task(async() => { arduino.Send(leftWheelOn); arduino.Send(rightWheelOn); }); await task1; await delay; await task2; }
public ViewModel(IArduino arduino) { arduino.DataRecieved += ArduinoDataRecievedHandler; }
public Engine(ICommandProcessor commandProcessor, IArduino arduino) { _CommandProcessor = commandProcessor; _Arduino = arduino; }
public DownKeyCommand(IArduino arduino) : base(arduino) { OutCommands.Add(new TestLightOffCommand()); }
public Led(IArduino board, int pin, ITimer timer = null) : base(board, pin, timer) { SetPinMode(PinMode.Output); }
public LedPwm(IArduino board, int pin, ITimer timer = null) : base(board, pin, timer) { SetPinMode(PinMode.Pwm); }
public SinglePinComponent(IArduino board, int pin, ITimer timer = null) : base(board, timer) { Pin = pin; }
public Component(IArduino board, ITimer timer) { Board = board; _timer = timer ?? new Timer(); }
/// <param name='operations'> /// Reference to the ArduinoAPI.IArduino. /// </param> /// <param name='smtp'> /// Required. /// </param> /// <param name='haspeople'> /// Required. /// </param> /// <param name='cancellationToken'> /// Cancellation token. /// </param> public static async Task <string> PostBySmtpAndHaspeopleAsync(this IArduino operations, string smtp, string haspeople, CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Microsoft.Rest.HttpOperationResponse <string> result = await operations.PostBySmtpAndHaspeopleWithOperationResponseAsync(smtp, haspeople, cancellationToken).ConfigureAwait(false); return(result.Body); }
/// <param name='operations'> /// Reference to the ArduinoAPI.IArduino. /// </param> /// <param name='idCliente'> /// Required. /// </param> /// <param name='cancellationToken'> /// Cancellation token. /// </param> public static async Task <IList <SalaDeReuniao> > GetClienteByIdclienteAsync(this IArduino operations, int idCliente, CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Microsoft.Rest.HttpOperationResponse <System.Collections.Generic.IList <ArduinoAPI.Models.SalaDeReuniao> > result = await operations.GetClienteByIdclienteWithOperationResponseAsync(idCliente, cancellationToken).ConfigureAwait(false); return(result.Body); }
public void Setup() { _arduino = A.Fake <IArduino>(); _timer = new FakeTimer(); _led = new Led(_arduino, Pin, _timer); }
/// <param name='operations'> /// Reference to the ArduinoAPI.IArduino. /// </param> /// <param name='token'> /// Required. /// </param> /// <param name='cancellationToken'> /// Cancellation token. /// </param> public static async Task <string> LimparByTokenAsync(this IArduino operations, string token, CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { Microsoft.Rest.HttpOperationResponse <string> result = await operations.LimparByTokenWithOperationResponseAsync(token, cancellationToken).ConfigureAwait(false); return(result.Body); }
public LedBase(IArduino board, int pin, ITimer timer = null) : base(board, pin, timer) { OnStateChanged = state => { }; Off(); }
public HeartbeatService(IArduino arduino) { _arduino = arduino; }
/// <summary> /// Initializes a new instance of the FusionExchangeArduino class. /// </summary> public FusionExchangeArduino() : base() { this._arduino = new Arduino(this); this._baseUri = new Uri("https://Fusionexchangearduino.azurewebsites.net"); }
public LedRGB(IArduino board, int redPin, int greenPin, int bluePin, ITimer timer = null) : this(board, new[] {redPin, greenPin, bluePin}, timer) { }
/// <summary> /// Initializes a new instance of the FusionExchangeArduino class. /// </summary> /// <param name='rootHandler'> /// Optional. The http client handler used to handle http transport. /// </param> /// <param name='handlers'> /// Optional. The set of delegating handlers to insert in the http /// client pipeline. /// </param> public FusionExchangeArduino(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) { this._arduino = new Arduino(this); this._baseUri = new Uri("https://Fusionexchangearduino.azurewebsites.net"); }
public MultiPinComponentcs(IArduino board, IEnumerable <int> pins, ITimer timer = null) : base(board, timer) { Pins = pins; }
public UpKeyCommand(IArduino arduino) : base(arduino) { OutCommands.Add(new TestLightOnCommand()); }
public MultiPinComponentcs(IArduino board, IEnumerable<int> pins, ITimer timer = null) : base(board, timer) { Pins = pins; }