private async void SendCsObject() { var actions = new ActionBase[] { new BuzzerSimpleAction { ConfigName = "BuzzerSimpleAction", Enabled = false, PreDelayMs = 0, PostDelayMs = 0, LoopCount = 3, StartDurationMs = 1000, EndDurationMs = 500, StartValue = true, EndValue = false, }, new LedSimpleAction { ConfigName = "LedSimpleAction", Enabled = false, PreDelayMs = 0, PostDelayMs = 0, LoopCount = 3, StartDurationMs = 1000, EndDurationMs = 500, StartValue = true, EndValue = false, }, new RgbSimpleAction { ConfigName = "RgbSimpleAction", Enabled = false, PreDelayMs = 0, PostDelayMs = 0, LoopCount = 3, StartDurationMs = 1000, EndDurationMs = 500, StartValues = new bool[3] { true, true, true }, // red, green, blue EndValues = new bool[3] { false, false, false }, // all off }, new LedBuzzerSimpleAction { ConfigName = "LedBuzzerSimpleAction", Enabled = false, PreDelayMs = 0, PostDelayMs = 0, LoopCount = 3, StartDurationMs = 1000, EndDurationMs = 500, StartValue = true, EndValue = false, }, new ServoSimpleAction { ConfigName = "ServoSimpleAction", Enabled = false, PreDelayMs = 0, PostDelayMs = 0, // single int[] for degrees and delay assuming only a single servo RotationDegrees = new int[][] { new int[] { 0, 45, 90, 135, 180, 135, 90, 45, 0 } }, RotationDelayMs = new int[][] { new int[] { 500, 500, 500, 500, 500, 500, 500, 500, 0 } }, }, new TMP102SimpleAction { ConfigName = "TMP102SimpleAction", Enabled = false, PreDelayMs = 0, PostDelayMs = 0, ReadDelayMs = 5, DurationMs = 30000, // 30 seconds }, }; if (!actions.Any(a => a.Enabled)) { Console.WriteLine("%No actions enabled in code; modify SendCsObject() to enable those actions you have the bread board configured for.\n"); } else { string json = JsonConvert.SerializeObject( actions, new JsonSerializerSettings { TypeNameHandling = TypeNameHandling.Objects, TypeNameAssemblyFormat = System.Runtime.Serialization.Formatters.FormatterAssemblyStyle.Full }); await _gpioClient.SendActionAsync <dynamic>(JsonConvert.DeserializeObject(json), "/gpio/action"); } }