Пример #1
0
 /// <summary>
 /// Maps the Color object to a string that the arduino 
 /// can understand
 /// </summary>
 /// <param name="color"></param>
 private static string GetColorString(Color color)
 {
     var colorStringBuilder = new StringBuilder();
     colorStringBuilder.Append(color.Red.ToString("000"));
     colorStringBuilder.Append(color.Green.ToString("000"));
     colorStringBuilder.Append(color.Blue.ToString("000"));
     return colorStringBuilder.ToString();
 }
Пример #2
0
 /// <summary>
 /// Displays a specific color on the dioder
 /// </summary>
 /// <param name="color"></param>
 public void DisplayColor(Color color)
 {
     var colorString = GetColorString(color);
     _arduinoConnection.Write(colorString);
 }