Ejemplo n.º 1
0
        public Raspberry()                          //Teilt den LED objekten die Farbe und die LED-Pins zu.
        {
            Pi.Init <BootstrapWiringPi>();

            ledGreen  = new LED(LEDColor.Green, P1.Pin36);
            ledYellow = new LED(LEDColor.Yellow, P1.Pin38);
            ledBlue   = new LED(LEDColor.Blue, P1.Pin32);
            ledRed    = new LED(LEDColor.Red, P1.Pin40);

            JSP = new Joystick(JoystickE.Push, P1.Pin37);
            JSD = new Joystick(JoystickE.Down, P1.Pin33);
            JSL = new Joystick(JoystickE.Left, P1.Pin31);
            JSR = new Joystick(JoystickE.Right, P1.Pin29);
            JSU = new Joystick(JoystickE.Up, P1.Pin35);
        }
Ejemplo n.º 2
0
        public LED_Alg(int RN, Raspberry raspi)                         // wertet die mitgegebene Random nummer aus und teilt dementsprechend die LED's diesem Objekt zu.
        {
            ledGreen  = raspi[LEDColor.Green];
            ledYellow = raspi[LEDColor.Yellow];
            ledBlue   = raspi[LEDColor.Blue];
            ledRed    = raspi[LEDColor.Red];

            switch (RN)
            {
            case 1: N1 = ledGreen; N2 = ledBlue; break;

            case 2: N1 = ledGreen; N2 = ledYellow; break;

            case 3: N1 = ledGreen; N2 = ledRed; break;

            case 4: N1 = ledRed; N2 = ledYellow; N3 = ledBlue; Number = RN; break;

            case 5: Number = RN; break;
            }
        }