public readonly static int TempAverageCount = 8; //number of temps to average public static void Initialize() { Pins.ProbePit = new AnalogInput(FEZCerbuino.Pin.AnalogIn.A0); Pins.ProbeFood1 = new AnalogInput(FEZCerbuino.Pin.AnalogIn.A1); Pins.Buttons = new AnalogInput(FEZCerbuino.Pin.AnalogIn.A3); //Pins.Fan = new OutputPort(FEZCerbuino.Pin.Digital.D6, false); //Pins.OnboardLed = new OutputPort(FEZCerbuino.Pin.Digital.LED1, false); //Pins.Fan = new PWM(, 50000, 0.0, false); //FEZCerbuino.Pin.PWM.D0 Fan = new Fan(FEZCerbuino.Pin.PWM.A2); Probes = new Hashtable() { { ProbeType.Pit, new ProbeController(new GadgeteerProbe(_thermocouple), "Pit", ProbeType.Pit, DefaultPitTemp) }, { ProbeType.Food1, new ProbeController(new PinProbe(Pins.ProbeFood1, PinProbe.ProbeModel.Maverick), "Food", ProbeType.Food1, DefaultFoodTemp) } }; Buttons = new PinButton(Pins.Buttons); Menus = new Hashtable() { { MenuState.Welcome, new MenuPage(MenuState.Welcome) }, { MenuState.SetTemp_Pit, new MenuPage(MenuState.Pit) .AddBtn(Button.Left, MenuState.ShowTemps) .AddBtn(Button.Right, MenuState.Food1) .AddBtn(Button.Up, MenuState.SetTemp_Pit) .AddBtn(Button.Down, MenuState.SetTemp_Pit) }, { MenuState.SetTemp_Food1, new MenuPage(MenuState.Food1) .AddBtn(Button.Left, MenuState.Pit) .AddBtn(Button.Right, MenuState.Reports) .AddBtn(Button.Up, MenuState.SetTemp_Food1) .AddBtn(Button.Down, MenuState.SetTemp_Food1) }, { MenuState.ShowTemps, new MenuPage(MenuState.ShowTemps) .AddBtn(Button.Left, MenuState.Reports) .AddBtn(Button.Right, MenuState.Pit) }, { MenuState.Pit, new MenuPage(MenuState.Pit) .AddBtn(Button.Left, MenuState.ShowTemps) .AddBtn(Button.Right, MenuState.Food1) .AddBtn(Button.Up, MenuState.SetTemp_Pit) .AddBtn(Button.Down, MenuState.SetTemp_Pit) }, { MenuState.Food1, new MenuPage(MenuState.Food1) .AddBtn(Button.Left, MenuState.Pit) .AddBtn(Button.Right, MenuState.Reports) .AddBtn(Button.Up, MenuState.SetTemp_Food1) .AddBtn(Button.Down, MenuState.SetTemp_Food1) }, { MenuState.Reports, new MenuPage(MenuState.Reports) .AddBtn(Button.Left, MenuState.Food1) .AddBtn(Button.Right, MenuState.ShowTemps) //.AddBtn(Button.Up, MenuState.Report_Pit) //.AddBtn(Button.Down, MenuState.Report_Pit) }, //{ MenuState.Report_Pit, new MenuPage(MenuState.Report_Pit) // .AddBtn(Button.Left, MenuState.ShowTemps) // .AddBtn(Button.Right, MenuState.ShowTemps) // .AddBtn(Button.Up, MenuState.Reports) // .AddBtn(Button.Down, MenuState.Reports) }, }; }
public static void Initialize() { Pins.ProbePit = new AnalogInput(FEZCerbuino.Pin.AnalogIn.A0); Pins.ProbeFood1 = new AnalogInput(FEZCerbuino.Pin.AnalogIn.A1); Pins.Buttons = new AnalogInput(FEZCerbuino.Pin.AnalogIn.A3); //Pins.Fan = new OutputPort(FEZCerbuino.Pin.Digital.D6, false); //Pins.OnboardLed = new OutputPort(FEZCerbuino.Pin.Digital.LED1, false); //Pins.Fan = new PWM(, 50000, 0.0, false); //FEZCerbuino.Pin.PWM.D0 Fan = new Fan(FEZCerbuino.Pin.PWM.A2); Probes = new Hashtable() { { ProbeType.Pit, new ProbeController(new GadgeteerProbe(_thermocouple), "Pit", ProbeType.Pit, DefaultPitTemp)}, { ProbeType.Food1, new ProbeController(new PinProbe(Pins.ProbeFood1, PinProbe.ProbeModel.Maverick), "Food", ProbeType.Food1, DefaultFoodTemp) } }; Buttons = new PinButton(Pins.Buttons); Menus = new Hashtable() { { MenuState.Welcome, new MenuPage(MenuState.Welcome) }, { MenuState.SetTemp_Pit, new MenuPage(MenuState.Pit) .AddBtn(Button.Left, MenuState.ShowTemps) .AddBtn(Button.Right, MenuState.Food1) .AddBtn(Button.Up, MenuState.SetTemp_Pit) .AddBtn(Button.Down, MenuState.SetTemp_Pit) }, { MenuState.SetTemp_Food1, new MenuPage(MenuState.Food1) .AddBtn(Button.Left, MenuState.Pit) .AddBtn(Button.Right, MenuState.Reports) .AddBtn(Button.Up, MenuState.SetTemp_Food1) .AddBtn(Button.Down, MenuState.SetTemp_Food1) }, { MenuState.ShowTemps, new MenuPage(MenuState.ShowTemps) .AddBtn(Button.Left, MenuState.Reports) .AddBtn(Button.Right, MenuState.Pit) }, { MenuState.Pit, new MenuPage(MenuState.Pit) .AddBtn(Button.Left, MenuState.ShowTemps) .AddBtn(Button.Right, MenuState.Food1) .AddBtn(Button.Up, MenuState.SetTemp_Pit) .AddBtn(Button.Down, MenuState.SetTemp_Pit) }, { MenuState.Food1, new MenuPage(MenuState.Food1) .AddBtn(Button.Left, MenuState.Pit) .AddBtn(Button.Right, MenuState.Reports) .AddBtn(Button.Up, MenuState.SetTemp_Food1) .AddBtn(Button.Down, MenuState.SetTemp_Food1) }, { MenuState.Reports, new MenuPage(MenuState.Reports) .AddBtn(Button.Left, MenuState.Food1) .AddBtn(Button.Right, MenuState.ShowTemps) //.AddBtn(Button.Up, MenuState.Report_Pit) //.AddBtn(Button.Down, MenuState.Report_Pit) }, //{ MenuState.Report_Pit, new MenuPage(MenuState.Report_Pit) // .AddBtn(Button.Left, MenuState.ShowTemps) // .AddBtn(Button.Right, MenuState.ShowTemps) // .AddBtn(Button.Up, MenuState.Reports) // .AddBtn(Button.Down, MenuState.Reports) }, }; }