1
I’m developing an application in C# with Visual Studio that sends a character to the Arduino only now I want to send a string with this structure character, number as in the example below:
A,0
or R,30
or L,15
I have to perform the split and take the separate values, a Character and another Whole.
This is the Arduino code I have so far:
void loop() {
if (Serial.available())
{
caractere = Serial.read();
}
/* AQUI REALIZO O SPLIT */
if( caractere == 'R')
{
Serial.println(caractere);
giraHorario(VALOR INTEIRO AQUI);
}
else if( caractere == 'L')
{
Serial.println(caractere);
giraAntiHorario(VALOR INTEIRO AQUI);
}
else if(caractere == 'A')
{
Serial.println(caractere);
giraAlternado(VALOR INTEIRO AQUI);
}
}