public void Page_Load(object sender, EventArgs e) { var sourcePath = Request.QueryString ["src"]; var port = Request.QueryString ["port"]; var board = Request.QueryString ["board"]; //var delay = Convert.ToInt32(Request.QueryString ["delay"]); var moistureSensorPinStrings = Request.QueryString ["mspins"].Split(','); var moistureSensorPins = new List<int> (); foreach (var pinString in moistureSensorPinStrings) { moistureSensorPins.Add (Convert.ToInt32 (pinString)); } var pumpPinStrings = Request.QueryString ["ppins"].Split(','); var pumpPins = new List<int> (); foreach (var pinString in pumpPinStrings) { pumpPins.Add (Convert.ToInt32 (pinString)); } var thresholdPinStrings = Request.QueryString ["ppins"].Split(','); var thresholdPins = new List<int> (); foreach (var pinString in thresholdPinStrings) { thresholdPins.Add (Convert.ToInt32 (pinString)); } var builder = new GreenKitBuilder (sourcePath); var code = builder.Build (moistureSensorPins.ToArray(), pumpPins.ToArray(), thresholdPins.ToArray()); var uploader = new DuinoUploader (); Output = uploader.UploadCode(code, port, board); }
public void Page_Load(object sender, EventArgs e) { var sourcePath = Request.QueryString ["src"]; var port = Request.QueryString ["port"]; var board = Request.QueryString ["board"]; var delay = Convert.ToInt32(Request.QueryString ["delay"]); var ledPinStrings = Request.QueryString ["pins"].Split(','); var ledPins = new List<int> (); foreach (var pinString in ledPinStrings) { ledPins.Add (Convert.ToInt32 (pinString)); } var builder = new BlinkBuilder (); var code = builder.Build (ledPins.ToArray(), delay); var uploader = new DuinoUploader (); Output = uploader.UploadCode(code, port, board); }