1
I’m creating a string
through two values, one read through a slider and the other through a check box. Put the two together in a string called a
and send at the same time in the serial.
Follows the code :
private async void SendSerial()
{
DirectionRotation = (bool)RotateInverter.IsChecked ? 1 : 0;// if ternario, check box marcado envia 1, check box desmarcado envia 0
string a = _dataSent1 = $"{Pwm_Control.Value.ToString()},{DirectionRotation}";//cria string de envia para a serial
if (sp.IsOpen)
{
sp.Write(a);//escreve na serial
}
else
{
await this.ShowMessageAsync("AVISO", "Porta desconectada");
}
this.Dispatcher.Invoke(() => { StatusSerialSent.Text = $"StatusSerialSent : {a}"; });// mostra na tela valor que esta sendo enviado
}
I would like to know how to send two strings, one in sequence of the other. But with a however, for example the string with the value of check box
is only sent when its value is changed. Someone has a tooltip on how to?
I don’t understand what you probably want because information is missing, but I can see problems in this code, and I don’t think any of it is related to the question.
– Maniero