コード例 #1
0
        public async void ProcessInstruction(FlashInstruction f)
        {
            switch (f.TaperDirection)
            {
            case Taper.TaperType.UP:
                for (int i = 0; i < f.Duration; i += interval)
                {
                    //  SetPWM()
                    await Task.Delay(interval);
                }
                break;

            case Taper.TaperType.DOWN:
                break;

            case Taper.TaperType.NONE:
                break;

            case Taper.TaperType.FLAT:
                break;

            default:
                break;
            }
        }
コード例 #2
0
ファイル: FireFly.cs プロジェクト: yaksplat/FireFlySunset
        public void GenerateFlashSequence()
        {
            FlashInstructions = new List <FlashInstruction>();
            Flash f = (from c in species.Flashes where c.sex == Sex select c).FirstOrDefault();

            foreach (Taper t in f.Tapers)
            {
                FlashInstruction fi = new FlashInstruction();
                fi.Duration       = t.Duration;
                fi.EndIntensity   = t.EndIntensity;
                fi.StartIntensity = t.StartIntensity;
                fi.TaperDirection = t.TaperDirection;
                FlashInstructions.Add(fi);
            }
        }