public Mode(ShotModel model, Setting[] settings) { //if (settings == null || settings.Length == 0) // throw new ArgumentNullException("settings"); this.model = model; this.settings = settings; currentSetting = 0; }
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(); }
public TriggerDelaySetting(ShotModel model) : base(model) { }
public HomeMode(ShotModel model) : base(model, new Setting[] { }) { line1 = "Shot Bru (V1.0)"; line2 = " >> press menu"; }
public AutoResetDelaySetting(ShotModel model) : base(model) { }
public TriggerEdgeSetting(ShotModel model) : base(model) { }
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); }
public Setting(ShotModel model) { this.model = model; }
public ThresholdSetting(ShotModel model) : base(model) { }
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(); }