Go Down

Topic: Due Serial Communication (Read 627 times) previous topic - next topic

hboland

I am new to programming with the Arduino. I am trying to set up basic serial communication in the IDE but I keep receiving the error, "Serial 2 was not declared in this scope".
This is my code (very basic):

Code: [Select]
void setup() {
  Serial.begin(38400);
  Serial2.begin(9600);

}

void loop() {
 
}


I'm thinking I'm doing something wrong with the settings. Can someone help me? Thank You!
I have attached a print screen image of the error.

Palliser

Hello,
I am not sure but it looks to me like you have set Arduino Uno board or other but the Due in the IDE. Please, verify your setting.

Tools->Board->Arduino Due  (Programming Port).

Regards!


hboland

This is the settings that I have set. Is this incorrect?

noblepepper

Yes, that is an incorrect selection.

You need one of the two at the very bottom of the list in your screen shot, I always use the programming port which is the one close to the power connector.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy