Pages: [1]   Go Down
Author Topic: Due Serial Communication  (Read 522 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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.


* Serial Error.jpg (60.18 KB, 494x432 - viewed 25 times.)
Logged

Venezuela
Offline Offline
God Member
*****
Karma: 17
Posts: 522
Ground, ground, always ground
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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!

Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


* arduino error.jpg (102.92 KB, 584x662 - viewed 31 times.)
Logged

Nashville Tennessee, USA
Offline Offline
Sr. Member
****
Karma: 15
Posts: 367
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: