I'm developing a C # application with Visual Studio which sends a character to the Arduino only I now want to send a string with this character structure, number as in the example below:
A,0
or R,30
or L,15
I have to split and get separate values, one Character and another Integer .
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);
}
}