Exemplo n.º 1
0
        public async void ExecuteAnalogRead_Click(object sender, EventArgs e)
        {
            OperationsPanel.Enabled  = false;
            CredentialsPanel.Enabled = false;
            Response.Text            = "Waiting for response..";
            Status.Text = "Executing..";

            Bolt myBolt = new Bolt(ApiKey.Text.Trim(), DeviceId.Text.Trim());

            RequestURL.Text = BuildRequestUrl("analogRead", new List <string> {
                "pin"
            }, new List <string> {
                AnalogPins.A0
            });

            Response response = await myBolt.AnalogRead(AnalogPins.A0);

            Response.Text            = response.ResponseString;
            Status.Text              = "Ready";
            OperationsPanel.Enabled  = true;
            CredentialsPanel.Enabled = true;
        }