private async void F_Flash(object sender, EventArgs e) { FireFly f = (FireFly)sender; // ushort brightness = 0; // Debug.WriteLine(String.Format("{0} On board {1} port {2}: full ON", DateTime.Now.ToString(), Address, f.ID)); // SetPWM(f.ID, brightness, 2000); //full off wired to GND, ON wired to +3.3v // await Task.Delay(500); //Console.Writeline // Debug.WriteLine(String.Format("{0} On board {1} port {2}: full OFF", DateTime.Now.ToString(), Address, f.ID)); // SetPWM(f.ID, 4096, 0); // full on wired to GND, off wired to +3.3v // LEDstatus[f.ID] = f.CurrentBrightness; }
public void InitializeFireFlies() { string Sex = "M"; for (int i = 0; i < FireflyCount; i++) { FireFly f = new FireFly(SwarmSpecies, Sex, interval, MaxDelay); f.ID = i; FireFlies.Add(f); //alternate gender Sex = (Sex == "M") ? "F" : "M"; } }
public void syncDelays(FireFly male, FireFly female) { female.InitialDelay = male.InitialDelay; female.DelayInstructionSet = male.DelayInstructionSet; female.TranslatedDelayInstructionSet = male.TranslatedDelayInstructionSet; }