2
So I send you a piece of my script so you can help me. I need to return the variable rsp
, that has always brought the value equal to 0, which was not to be done.
// Envia comando de Leitura de Posição
serial.Write('R');
serial.Write('7');// controle: absoluto (1) pra cima(1) e velocidade (3)
serial.Write(' ');// angulo inicial
System.Console.WriteLine("Comando enviado.");
// Espera a resposta da Luneta
rsp = serial.ReadChar();
System.Console.WriteLine("Resposta recebida.");
//Mostra resposta na Output Window
Console.WriteChar("Resposta: " + rsp);
Apparently, your problem isn’t in that code snippet. If rsp is at zero, serial.Readchar() is returning 0 and this is probably the fault of something internal to it, but we don’t know what is serial or where it is created/declared. There’s little context to understand.
– Pablo Almeida
So Pablo this serial is a communication port between a printed circuit board and pc. from RS485 to USB.
– Raiane
Then Marconcilio the code serves to move a bezel where initially we do not know where the angle is, so we have a value of the table ascii 'R' that receives this information. These values are displayed through a display. Initially this value of the rsp variable should be the value of 'R' which does not occur.
– Raiane
Thanks boys for the help, as Pablo had commented q could be something internal went looking for and really he was not transmitting the due value and I ended up having q exchange a pic q was using because he could receive but not transmit.
– Raiane