Example #1
0
        // Note: A constructor summary is auto-generated by the doc builder.
        /// <summary></summary>
        /// <param name="socketNumber">The socket that this module is plugged in to.</param>
        public IO60P16(int socketNumber)
        {
            Socket socket = Socket.GetSocket(socketNumber, true, this, null);

            socket.EnsureTypeIsSupported(new char[] { 'X', 'Y' }, this);

            softwareI2C = new SoftwareI2C(socket, Socket.Pin.Five, Socket.Pin.Four, this);
            //softwareI2C = new SoftwareI2C(socket, Socket.Pin.Eight, Socket.Pin.Nine, this);

            Reset();
        }
Example #2
0
        // Note: A constructor summary is auto-generated by the doc builder.
        /// <summary></summary>
        /// <param name="socketNumber">The socket that this module is plugged in to.</param>
        public ColorSense(int socketNumber)
        {
            Socket socket = Socket.GetSocket(socketNumber, true, this, null);

            socket.EnsureTypeIsSupported(new char[] { 'X', 'Y' }, this);

            LEDControl = new GTI.DigitalOutput(socket, Socket.Pin.Three, false, this);

            softwareI2C = new GTI.SoftwareI2C(socket, Socket.Pin.Five, Socket.Pin.Four, this);

            // Send COMMAND to access control register for chip power-up
            // Send to power-up chip
            softwareI2C.Write(colorAddress, new byte[] { 0x80, 0x03 });
        }
Example #3
0
        // Note: A constructor summary is auto-generated by the doc builder.
        /// <summary></summary>
        /// <remarks>The ordering of the RGB socket numbers does not matter (socket numbers are autodetected)</remarks>
        /// <param name="rgbSocketNumber1">The mainboard socket that has the display's R, G, or B socket connected to it.</param>
        /// <param name="rgbSocketNumber2">The mainboard socket that has the display's R, G, or B socket connected to it.</param>
        /// <param name="rgbSocketNumber3">The mainboard socket that has the display's R, G, or B socket connected to it.</param>
        /// <param name="i2cSocketNumber">The mainboard socket that has the display's X socket connected to it.</param>
        public VideoOut(int rgbSocketNumber1, int rgbSocketNumber2, int rgbSocketNumber3, int i2cSocketNumber)
            : base(WPFRenderOptions.Ignore)
        {
            // This finds the Socket instance from the user-specified socket number.
            // This will generate user-friendly error messages if the socket is invalid.
            // If there is more than one socket on this module, then instead of "null" for the last parameter,
            // put text that identifies the socket to the user (e.g. "S" if there is a socket type S)
            //Socket socket = Socket.GetSocket(socketNumber, true, this, null);
            ReserveLCDPins(rgbSocketNumber1, rgbSocketNumber2, rgbSocketNumber3);

            Socket i2cSocket = Socket.GetSocket(i2cSocketNumber, true, this, null);

            i2cSocket.EnsureTypeIsSupported(new char[] { 'X', 'Y' }, this);

            //i2cBus2 = new GTI.I2CBus(i2cSocket, DEVICE_ADDR, 100, this);
            softwareI2C = new GTI.SoftwareI2C(i2cSocket, Socket.Pin.Five, Socket.Pin.Four, this);
        }
Example #4
0
        /// <summary>An FM radio module for Microsoft .NET Gadgeteer</summary>
        /// <param name="socketNumber">The socket that this module is plugged in to.</param>
        public RadioFM1(int socketNumber)
        {
            Socket socket = Socket.GetSocket(socketNumber, true, this, null);

            socket.EnsureTypeIsSupported(new char[] { 'Y' }, this);

            this.resetPin = new GTI.DigitalOutput(socket, Socket.Pin.Five, false, this);
            this.i2cBus   = new GTI.SoftwareI2C(socket, Socket.Pin.Eight, Socket.Pin.Nine, this);

            this.InitializeDevice();

            this.SetChannelConfiguration(Spacing.USAAustrailia, Band.USAEurope);

            this.Channel = this.MinChannel;
            this.Volume  = RadioFM1.MIN_VOLUME;

            this.radioTextWorkerThread = new Thread(this.RadioTextWorker);
            this.radioTextWorkerThread.Start();
        }