Hello:
Arduino UNO R3 connect via USB. I have a very simple fact that input code something works.
byte Datos;
void setup()
{
Serial.begin(9600);
}
void loop() {
if (Serial.available())
{
Datos = Serial.read();
if (Datos == 'A')
{
Serial.println("Vida: Ha llegado variable A: ");
}
if (Datos == 'B')
{
Serial.println("Balas: Ha llegado variable B: ");
}
if (Datos == 'C')
{
Serial.println("Mana: Ha llegado variable C: ");
}
}
delay(100);
}
I intend to connect a 16x2 LCD display for now I'll settle view the data in the "Serial Monitor" in Arduino IDE 1.0.5.
I made a small application in C # to send data to Arduino. Three variables. To distinguish each, first send a byte 'A', behind him a decimal numeric values ??shown thereupon send 'B' with other numerical data to execute code in B above and the same for 'C' .
If I send this secuantia from C #:
A100B10C100
In the serial monitor shows this:
Vida: Ha llegado variable A:
Balas: Ha llegado variable B:
Mana: Ha llegado variable C:
Should appear:
Vida: Ha llegado variable A:
Vida: 100
Balas: Ha llegado variable B:
Balas: 10
Mana: Ha llegado variable C:
Mana: 100
How do I get to capture data in each corresponding numbers if?
I hope I have explained well.
A greeting.