Skip to main content
added 36 characters in body
Source Link
Michel Keijzers
  • 13k
  • 7
  • 42
  • 59

I am writing a very simple code in Arduino Nano, in which I am reading data that I send on Serial. Here is the code snippet.

int incomingByte ;

void setup() { Serial.begin(9600);
}

void loop() {

int incomingByte ;   

void setup() {
        Serial.begin(9600);   
}

void loop() {

    
    if (Serial.available() > 0) {
           
            incomingByte = Serial.read();

        
            Serial.print("I received: ");
            Serial.println(incomingByte);
    }

}

When I send 'A' , I receive the following output:

I received: 65

I received: 13

I received: 10

What is wrong with the working of Serial Port here?

I am writing a very simple code in Arduino Nano, in which I am reading data that I send on Serial. Here is the code snippet.

int incomingByte ;

void setup() { Serial.begin(9600);
}

void loop() {

    if (Serial.available() > 0) {
           
            incomingByte = Serial.read();

        
            Serial.print("I received: ");
            Serial.println(incomingByte);
    }

}

When I send 'A' , I receive the following output:

I received: 65

I received: 13

I received: 10

What is wrong with the working of Serial Port here?

I am writing a very simple code in Arduino Nano, in which I am reading data that I send on Serial. Here is the code snippet.

int incomingByte ;   

void setup() {
        Serial.begin(9600);   
}

void loop() {

    
    if (Serial.available() > 0) {
           
            incomingByte = Serial.read();

        
            Serial.print("I received: ");
            Serial.println(incomingByte);
    }

}

When I send 'A' , I receive the following output:

I received: 65

I received: 13

I received: 10

What is wrong with the working of Serial Port here?

Source Link
skii
  • 33
  • 1
  • 5

Receiving Multiple data on Arduino Serial

I am writing a very simple code in Arduino Nano, in which I am reading data that I send on Serial. Here is the code snippet.

int incomingByte ;

void setup() { Serial.begin(9600);
}

void loop() {

    if (Serial.available() > 0) {
           
            incomingByte = Serial.read();

        
            Serial.print("I received: ");
            Serial.println(incomingByte);
    }

}

When I send 'A' , I receive the following output:

I received: 65

I received: 13

I received: 10

What is wrong with the working of Serial Port here?