private async void CommandsTimer_Tick(object sender, object e)
{
string message = await ctdHelper.ReceiveMessage();
if (message != string.Empty)
{
System.Diagnostics.Debug.WriteLine("Command Received: {0}", message);
switch (message.ToUpperInvariant())
{
case "RED":
hat.D2.Color = new FEZHAT.Color(255, 0, 0);
break;
case "GREEN":
hat.D2.Color = new FEZHAT.Color(0, 255, 0);
break;
case "BLUE":
hat.D2.Color = new FEZHAT.Color(0, 0, 255);
break;
case "OFF":
hat.D2.TurnOff();
break;
default:
System.Diagnostics.Debug.WriteLine("Unrecognized command: {0}", message);
break;
}
}
}