Beispiel #1
0
        void ProgramStarted()
        {
            Debug.Print("Program Started");

            // create the model
            Model model = new Model(4);

            // setup the sensors
            int[] sockets = { 3, 3, 4, 4 };
            byte[] addresses = { 1, 2, 3, 4 };
            Ranger ranger = new Ranger(sockets, addresses);
            Controller controller = new Controller(model, ranger, button);

            // setup the tunes modules
            TunesModule leftTunes = new TunesModule(11, model);
            TunesModule rightTunes = new TunesModule(8, model);
            TunesListener tunesListener = new TunesListener(leftTunes, rightTunes);
            model.addModelListener(tunesListener);

            // calibrate everything
            controller.calibrate();

            // start ranging
            ranger.startRanging();

            Debug.Print("Initialisation Ended");
        }
        public TunesListener(TunesModule tunesL, TunesModule tunesR)
        {
            this.tunesL = tunesL;
            this.tunesR = tunesR;

            timerL = new BeepingTimer(beepingFunctionLeft);
            timerR = new BeepingTimer(beepingFunctionRight);
            timerF = new BeepingTimer(beepingFunctionFront);
        }