コード例 #1
0
 public NusbioLandscapeMatrix(NusbioMatrix nusbioMatrix, int deviceIndex)
 {
     this._deviceIndex     = deviceIndex;
     this._nusbioMatrix    = nusbioMatrix;
     this.CurrentXPosition = this._nusbioMatrix.Width - 1;
     this.CurrentYPosition = this._nusbioMatrix.Height - 1;
     _nusbioMatrix.Clear(this._deviceIndex, true);
 }
コード例 #2
0
        public NusbioGameMatrix(NusbioMatrix nusbioMatrix)
        {
            NusbioMatrix = nusbioMatrix;
            _mainBall    = new NusbioGameMatrixBall(2, 0, this);
            Rackette     = new NusbioMatrixGameRackette(7, 3, this);

            _objects = new List <NusbioGameMatrixObject>();
            _objects.Add(_mainBall);
            _objects.Add(Rackette);
        }
コード例 #3
0
        public static NusbioMatrix Initialize(
            Nusbio nusbio,
            NusbioGpio selectGpio,
            NusbioGpio mosiGpio,
            NusbioGpio clockGpio,
            NusbioGpio gndGpio,
            MAX7219_WIRING_TO_8x8_LED_MATRIX MAX7218Wiring,
            int deviceCount = 0)
        {
            // How to plug the 8x8 LED Matrix MAX7219 into Nusbio
            // --------------------------------------------------------------------------------
            // NUSBIO                          : GND VCC  7   6  5   4  3  2  1  0
            // 8x8 LED Matrix MAX7219 base     :     VCC GND DIN CS CLK
            // Gpio 7 act as ground so we can plug directly the 8x8 led matrix
            //
            // If you use a regular breadboard to connect the 8x8 LED matrix to Nusbio
            // Connect the LED Matrix's GND to the Nusbio's GND and set parameter gndGpio to None.
            var matrix = new NusbioMatrix(nusbio, selectGpio, mosiGpio,
                                          clockGpio, gndGpio,
                                          MAX7218Wiring, deviceCount: deviceCount);

            matrix.Begin(DEFAULT_BRIGTHNESS_DEMO);
            return(matrix);
        }