public void LedEffect(Color color, EffectType effectType, int effectLength, int effectInterval) { LedProxy.LogiLedStopEffects(); Thread.Sleep(100); LedProxy.LogiLedSetLighting(Constants.DEFAULT_RED_PCT, Constants.DEFAULT_GREEN_PCT, Constants.DEFAULT_BLUE_PCT); Thread.Sleep(100); switch (effectType) { case (EffectType.FLASH): LedProxy .LogiLedFlashLighting( color.Red, color.Green, color.Blue, effectLength, effectInterval); break; case (EffectType.PULSE): LedProxy .LogiLedPulseLighting( color.Red, color.Green, color.Blue, effectLength, effectInterval); break; } Task.Run(() => ResetLightingAfterEffect(effectLength)); }
public Connection(string appFriendlyName = "testapp") { AppFriendlyName = appFriendlyName; LcdProxy.LogiLcdInit(AppFriendlyName, Constants.LOGI_LCD_TYPE_MONO); Success = LcdProxy.LogiLcdIsConnected(Constants.LOGI_LCD_TYPE_MONO); if (Success) { LedSuccess = LedProxy.LogiLedInit(); } }
public async Task ResetLightingAfterEffect(int effectLength) { var stopwatch = new Stopwatch(); stopwatch.Start(); while (stopwatch.ElapsedMilliseconds < effectLength) { Thread.Sleep(50); } LedProxy.LogiLedSetLighting(Constants.DEFAULT_RED_PCT, Constants.DEFAULT_GREEN_PCT, Constants.DEFAULT_BLUE_PCT); }
public bool SaveCurrentLighting() { return(LedProxy.LogiLedSaveCurrentLighting()); }
public void SetLightingToDefault() { LedProxy.LogiLedSetLighting(DefaultColor.Red, DefaultColor.Green, DefaultColor.Blue); }