【发布时间】:2017-11-20 02:30:27
【问题描述】:
我正在尝试每秒改变灯光的颜色,我正在使用以下代码。
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 颜色。
我的代码有什么问题?
【问题讨论】:
标签: c# philips-hue