protected LedCube(byte size, Cpu.Pin[] levelPins, Cpu.Pin[] ledPins, CubeOrientations orientation = CubeOrientations.ZPos ) { Size = size; Orientation = orientation; Levels = new OutputPort[Size]; Leds = new OutputPort[Size*Size]; // Make sure we have the correct number of level pins. if(levelPins.Length != size) { throw new ArgumentOutOfRangeException("levelPins", "You must define " + Size + " level pins."); } // Make sure we have the correct number of LED pins. if (ledPins.Length != size * size) { throw new ArgumentOutOfRangeException("ledPins", "You must define " + Size*Size + " led pins."); } // Create level ports. for (byte lvl = 0; lvl < Size; lvl++ ) { Levels[lvl] = new OutputPort(levelPins[lvl], false); } // Create LED ports. for (byte led = 0; led < Size*Size; led++) { Leds[led] = new OutputPort(ledPins[led], false); } }
public LedCube3( byte size, Cpu.Pin[] levelPins, Cpu.Pin[] ledPins, CubeOrientations orientation = CubeOrientations.ZPos) : base(size, levelPins, ledPins, orientation) { }
public LedCube3(IO60P16Module parentModule, byte size, IOPin[] levelPins, IOPin[] ledPins, CubeOrientations orientation = CubeOrientations.ZPos) : base(parentModule, size, levelPins, ledPins, orientation) { }