public override void SetLightBrightness(string port, int brightness) { Port portObj = GetPortFromPortId(port); // If we can't find the port, we can't do anything! if (portObj == null) { MainBoard.WriteLine("Could not set Light Brightness for " + Name + " because no default port are setup", Color.Red); return; } portObj.Speed = brightness; OnDataUpdated(); byte[] data = new byte[6]; data[0] = 0x10; foreach (Port p in RegistredPorts) { data[RegistredPorts.IndexOf(p) + 1] = (byte)p.Speed; } data[5] = 0; WriteMessage(data, false); }
public override void InitPorts() { // Clear any previous port RegistredPorts.Clear(); Port portA = new Port("A", 0, true); Port portB = new Port("B", 1, true); Port portC = new Port("C", 2, true); Port portD = new Port("D", 3, true); Port port1 = new Port("One", 4, true); Port port2 = new Port("Two", 5, true); Port port3 = new Port("Three", 6, true); Port port4 = new Port("Four", 7, true); RegistredPorts.Add(portA); RegistredPorts.Add(portB); RegistredPorts.Add(portC); RegistredPorts.Add(portD); RegistredPorts.Add(port1); RegistredPorts.Add(port2); RegistredPorts.Add(port3); RegistredPorts.Add(port4); }
public override void InitPorts() { // Clear any previous port RegistredPorts.Clear(); Port portA = new Port("A", 1, true); Port portB = new Port("B", 2, true); RegistredPorts.Add(portA); RegistredPorts.Add(portB); }
public override void InitPorts() { // Clear any previous port RegistredPorts.Clear(); Port portA = new Port("A", 0, true); Port portB = new Port("B", 1, true); RegistredPorts.Add(portA); RegistredPorts.Add(portB); portA.Function = Port.Functions.BUTTON; portB.Function = Port.Functions.BUTTON; }
public override void InitPorts() { // Clear any previous port RegistredPorts.Clear(); Port portA = new Port("A", 0, true); Port portB = new Port("B", 2, true); Port portC = new Port("C", 1, true); Port portD = new Port("D", 3, true); RegistredPorts.Add(portA); RegistredPorts.Add(portB); RegistredPorts.Add(portC); RegistredPorts.Add(portD); portA.Function = Port.Functions.MOTOR; portB.Function = Port.Functions.MOTOR; portC.Function = Port.Functions.MOTOR; portD.Function = Port.Functions.MOTOR; }