1
私はライトの色を毎秒変更しようとしています。次のコードを使用しています。ライトの色を毎秒変更します
private async void button5_Click(object sender, EventArgs e)
{
var command = new LightCommand();
command.TurnOn().SetColor("BC8F8F");
command.Brightness = 128;
while (true)
{
command.Alert = Alert.Once;
command.TransitionTime = TimeSpan.FromMilliseconds(100);
command.TurnOn().SetColor("0054FF");
command.Alert = Alert.Once;
command.TurnOn().SetColor("BC8F8F");
command.TransitionTime = TimeSpan.FromMilliseconds(100);
var result = await client.SendCommandAsync(command);
}
}
私の目標は、交互に0054FFとBC8F8F、各秒の間の色を変えているが、私はそれをデバッグするとき、唯一のBC8F8Fの色が表示されます。
私のコードにはどのような問題がありますか?
どうすれば2つ送信できますか?私は1つのボタンを使用したい! –