public static void LoadEffects(string fileName, LEDStrip displayStrip, List <EffectContainer> list) { Console.WriteLine("Settings: Openning file {0}", fileName); using (StreamReader rdr = new StreamReader(fileName)) { var effList = JsonConvert.DeserializeObject <List <EffectContainer> >(rdr.ReadToEnd(), new EffectConverter()); foreach (EffectContainer cont in effList) { Console.WriteLine("{0}, {1}", cont.Information.Name, cont.Information.IsScreenSaver); cont.AssignStrip(displayStrip); list.Add(cont); } } }
// Main entry function // This method executes when the mainboard is powered up or reset. void ProgramStarted() { Debug.Print("Welcome to Smart Security System!"); // Initialize Display, network, time, data this.LoadStartupView(); this.StartNetwork(); this.LoadData(); // Global output modules for led light, sound and motion ledLight = ledStrip; alarm = tunes; distSensor1 = distanceUS3; distSensor2 = distanceUS32; //this.LoadLoginView(); // temporary, should be deleted. }
private async void Page_Loaded(object sender, RoutedEventArgs e) { try { this.ledStrip = new LEDStrip(11, 10, 46); this.ledStrip.SetStripColor(Colors.Black); this.ledStrip.Refresh(); } catch (Exception ledException) { Logger.GetInstance().LogLine(ledException.Message); } //Init speech this.speechManager.ListenStateChanged += SpeechManager_ListenStateChanged; this.speechManager.SourceLanguageChanged += SpeechManager_SourceLanguageChanged; await movementManager.Initialize(); await this.voiceManager.Initialize(); await this.speechManager.Initialize(); this.SetupVoiceCommands(); this.MovePivot.SetMovementManager(this.movementManager); await this.reminderManager.Initialize(); this.SchedulePivot.SetReminderManager(this.reminderManager); this.SchedulePivot.SetVoiceManager(this.voiceManager); Odometer.Instance.PositionChanged += Instance_PositionChanged; await this.voiceManager.Speak("Hi, my name is Bamboo."); }