public static void WaitForAllButtonsAsync() { // http://stackoverflow.com/questions/3390286/making-a-console-application-like-a-windows-application PiAndBash.Display disp = new PiAndBash.Display(); disp.TopLine = "Simon"; disp.BottomLine = "< EXIT"; notePlayer = new NotePlayer(); notePlayer.CreateSamples(new double[] { 440, 523 }); PiAndBash.ButtonCatcher bc = new PiAndBash.ButtonCatcher(); bc.ButtonEvent += bc_ButtonEvent2; bc.Start(); }
public GameEngine(PiAndBash.Driver PiAndBashDriver, NotePlayer NotePlayer) { pnbDriver = PiAndBashDriver; pnbDisplay = new PiAndBash.Display(pnbDriver); leds = new PiAndBash.LedController(pnbDriver); buttonCatcher = new PiAndBash.ButtonCatcher(pnbDriver); notePlayer = NotePlayer; // set up the Notes and associations notes = new Dictionary <int, Note>(); notes.Add(1, new Note() { Color = PiAndBash.LedController.LightColor.Green, Button = PiAndBash.ButtonCatcher.ButtonType.Down, Frequency = 349 }); notes.Add(2, new Note() { Color = PiAndBash.LedController.LightColor.Yellow, Button = PiAndBash.ButtonCatcher.ButtonType.Enter, Frequency = 440 }); notes.Add(3, new Note() { Color = PiAndBash.LedController.LightColor.Red, Button = PiAndBash.ButtonCatcher.ButtonType.Up, Frequency = 523 }); }