示例#1
0
文件: Mode.cs 项目: shrimmy/ShotBru
        public Mode(ShotModel model, Setting[] settings)
        {
            //if (settings == null || settings.Length == 0)
            //    throw new ArgumentNullException("settings");

            this.model = model;
            this.settings = settings;
            currentSetting = 0;
        }
示例#2
0
文件: Sensor.cs 项目: shrimmy/ShotBru
        public Sensor(ShotModel model, Cpu.Pin analogInputPin, Cpu.Pin powerPin)
        {
            this.model = model;

            //isTriggered = false;
            currentValue = 0;
            //isPaused = true;
            //threshold = 550;
            //triggerType = TriggerType.Above;
            analogInput = new SecretLabs.NETMF.Hardware.AnalogInput(analogInputPin);
            power = new OutputPort(powerPin, true);
            // power up the sensor
            power.Write(false);
            thread = new Thread(new ThreadStart(ContinuousRead));
            thread.Start();
        }
示例#3
0
 public TriggerDelaySetting(ShotModel model)
     : base(model)
 {
 }
示例#4
0
 public HomeMode(ShotModel model)
     : base(model, new Setting[] { })
 {
     line1 = "Shot Bru (V1.0)";
     line2 = " >> press menu";
 }
示例#5
0
 public AutoResetDelaySetting(ShotModel model)
     : base(model)
 {
 }
示例#6
0
 public TriggerEdgeSetting(ShotModel model)
     : base(model)
 {
 }
示例#7
0
 public LightMode(ShotModel model)
     : base(model, new Setting[] { new TriggerEdgeSetting(model), new ThresholdSetting(model), new TriggerDelaySetting(model), new AutoResetSetting(model), new AutoResetDelaySetting(model) })
 {
     line1 = "Light Trigger";
     sb = new StringBuilder(16);
 }
示例#8
0
 public Setting(ShotModel model)
 {
     this.model = model;
 }
示例#9
0
 public ThresholdSetting(ShotModel model)
     : base(model)
 {
 }
示例#10
0
        private void Initialize()
        {
            lcd = new Lcd(new GpioLcdTransferProvider(lcd_RS, lcd_EN, lcd_D4, lcd_D5, lcd_D6, lcd_D7));
            lcd.Begin(16, 2);
            DisplayLine("Shot Bru (V1)");
            DisplayLine("Initializing...", 1);

            model = new ShotModel();
            modeController = new ModeController(new Mode[]
                {
                    new HomeMode(model),
                    new LightMode(model),
                });

            keyPad = new KeyPad(keyPad_Input);
            keyPad.KeyPressed += new KeyPressedEventHandler(keyPad_KeyPressed);

            sensor1 = new Sensor(model, sensor1_Input, sensor1_Power);
            sensor1.Triggered += new TriggerEventHandler(sensor1_Triggered);

            camera1 = new Camera(camera1_Shutter);

            // setup the display timer to fire every 250mS,
            displayTimer = new Timer(new TimerCallback(displayTimer_Fired), model, 250, 250);

            // wait for 1 second, gives sensors a chance to start up
            Thread.Sleep(1000);
            //sensor1.Start();
        }