Inheritance: Module
		private async void Setup() {
			this.mainboard = await GT.Module.CreateAsync<GTM.FEZCream>();
			this.ledStrip = await GT.Module.CreateAsync<GTM.LEDStrip>(this.mainboard.GetProvidedSocket(4));
			this.button = await GT.Module.CreateAsync<GTM.Button>(this.mainboard.GetProvidedSocket(3));

			this.ProgramStarted();
		}
Beispiel #2
0
        private async void Setup()
        {
            this.mainboard = await GT.Module.CreateAsync <GTM.FEZCream>();

            this.ledStrip = await GT.Module.CreateAsync <GTM.LEDStrip>(this.mainboard.GetProvidedSocket(4));

            this.button = await GT.Module.CreateAsync <GTM.Button>(this.mainboard.GetProvidedSocket(3));

            this.ProgramStarted();
        }
        private async void Setup()
        {
            mainboard = await GT.Module.CreateAsync <GTM.FEZCream>();

            joystick = await GT.Module.CreateAsync <GTM.Joystick>(mainboard.GetProvidedSocket(5));

            charDisplay = await GT.Module.CreateAsync <GTM.CharacterDisplay>(mainboard.GetProvidedSocket(8));

            this.ProgramStarted();
        }
 public async Task Initialize()
 {
     _mainboard = await GT.Module.CreateAsync<GTM.FEZCream>();
     _button = await GT.Module.CreateAsync<GTM.Button>(this._mainboard.GetProvidedSocket(3));
     _button.Released += _button_Released;
     _relays[0] = await GT.Module.CreateAsync<PGTM.RelayX1>(_mainboard.GetProvidedSocket(4));
     _relays[1] = await GT.Module.CreateAsync<PGTM.RelayX1>(_mainboard.GetProvidedSocket(8));
     SetButtonLed(false);
     SetRelay(0, false);
     SetRelay(1, false);
 }
Beispiel #5
0
        public async Task Initialize()
        {
            _mainboard = await GT.Module.CreateAsync <GTM.FEZCream>();

            _button = await GT.Module.CreateAsync <GTM.Button>(this._mainboard.GetProvidedSocket(3));

            _button.Released += _button_Released;
            _relays[0]        = await GT.Module.CreateAsync <PGTM.RelayX1>(_mainboard.GetProvidedSocket(4));

            _relays[1] = await GT.Module.CreateAsync <PGTM.RelayX1>(_mainboard.GetProvidedSocket(8));

            SetButtonLed(false);
            SetRelay(0, false);
            SetRelay(1, false);
        }
Beispiel #6
0
        protected async override Task Initialize()
        {
            this.gpioMap         = FEZCream.CreateGpioMap();
            this.analogMap       = FEZCream.CreateAnalogMap();
            this.pwmMap          = FEZCream.CreatePwmMap();
            this.analogSharedMap = FEZCream.CreateAnalogSharedMap();
            this.pwmSharedMap    = FEZCream.CreatePwmSharedMap();

            this.analog = new ADS7830(await NativeInterfaces.I2cDevice.CreateInterfaceAsync("I2C1", new I2cConnectionSettings(ADS7830.GetAddress(false, false))));
            this.pwm    = new PCA9685(await NativeInterfaces.I2cDevice.CreateInterfaceAsync("I2C1", new I2cConnectionSettings(PCA9685.GetAddress(true, true, true, true, true, true))));

            this.gpios    = new PCA9535[2];
            this.gpios[0] = new PCA9535(await NativeInterfaces.I2cDevice.CreateInterfaceAsync("I2C1", new I2cConnectionSettings(PCA9535.GetAddress(true, true, false))), await NativeInterfaces.DigitalIO.CreateInterfaceAsync(22));
            this.gpios[1] = new PCA9535(await NativeInterfaces.I2cDevice.CreateInterfaceAsync("I2C1", new I2cConnectionSettings(PCA9535.GetAddress(true, false, true))), await NativeInterfaces.DigitalIO.CreateInterfaceAsync(26));

            for (var i = 2; i <= 7; i++)
            {
                this.gpios[0].SetDriveMode(i, GpioPinDriveMode.Output);
                this.gpios[0].Write(i, true);
            }

            Socket socket;

            socket = this.CreateSocket(1);
            socket.AddSupportedTypes(SocketType.I);
            socket.SetNativePin(SocketPinNumber.Three, 18);
            socket.NativeI2cDeviceId = "I2C1";
            socket.DigitalIOCreator  = this.DigitalIOCreator;

            socket = this.CreateSocket(2);
            socket.AddSupportedTypes(SocketType.U);
            socket.NativeSerialDeviceId = "COM1";
            socket.DigitalIOCreator     = this.DigitalIOCreator;

            socket = this.CreateSocket(3);
            socket.AddSupportedTypes(SocketType.S, SocketType.X);
            socket.SetNativePin(SocketPinNumber.Three, 24);
            socket.SetNativePin(SocketPinNumber.Four, 25);
            socket.SetNativePin(SocketPinNumber.Five, 13);
            socket.NativeSpiDeviceId      = "SPI0";
            socket.NativeSpiChipSelectPin = 0;

            socket = this.CreateSocket(4);
            socket.AddSupportedTypes(SocketType.Y);
            socket.SetNativePin(SocketPinNumber.Three, 6);
            socket.DigitalIOCreator = this.DigitalIOCreator;

            socket = this.CreateSocket(5);
            socket.AddSupportedTypes(SocketType.A);
            socket.SetNativePin(SocketPinNumber.Three, 12);
            socket.DigitalIOCreator = this.DigitalIOCreator;
            socket.AnalogIOCreator  = this.AnalogIOCreator;

            socket = this.CreateSocket(6);
            socket.AddSupportedTypes(SocketType.A);
            socket.SetNativePin(SocketPinNumber.Three, 16);
            socket.DigitalIOCreator = this.DigitalIOCreator;
            socket.AnalogIOCreator  = this.AnalogIOCreator;

            socket = this.CreateSocket(7);
            socket.AddSupportedTypes(SocketType.P, SocketType.Y);
            socket.SetNativePin(SocketPinNumber.Three, 5);
            socket.DigitalIOCreator = this.DigitalIOCreator;
            socket.PwmOutputCreator = this.PwmOutputCreator;

            socket = this.CreateSocket(8);
            socket.AddSupportedTypes(SocketType.P, SocketType.Y);
            socket.SetNativePin(SocketPinNumber.Three, 27);
            socket.DigitalIOCreator = this.DigitalIOCreator;
            socket.PwmOutputCreator = this.PwmOutputCreator;

            socket = this.CreateSocket(9);
            socket.AddSupportedTypes(SocketType.I);
            socket.SetNativePin(SocketPinNumber.Three, 23);
            socket.NativeI2cDeviceId = "I2C1";
            socket.DigitalIOCreator  = this.DigitalIOCreator;
        }