Programming a Elegoo Robot with Arduino 1.8.8

Multi tool use
I've just started trying to program this Elegoo Car robot it. Elegoo Car Kit on Amazon
I am able to load programs no problem from examples that are provided. I am trying to get this robot to drive in a square. Here is my code.
//www.elegoo.com
// The direction of the car's movement
// ENA ENB IN1 IN2 IN3 IN4 Description
// HIGH HIGH HIGH LOW LOW HIGH Car is runing forward
// HIGH HIGH LOW HIGH HIGH LOW Car is runing back
// HIGH HIGH LOW HIGH LOW HIGH Car is turning left
// HIGH HIGH HIGH LOW HIGH LOW Car is turning right
// HIGH HIGH LOW LOW LOW LOW Car is stoped
// HIGH HIGH HIGH HIGH HIGH HIGH Car is stoped
// LOW LOW N/A N/A N/A N/A Car is stoped
//define L298n module IO Pin
#define ENA 5
#define ENB 6
#define IN1 7
#define IN2 8
#define IN3 9
#define IN4 11
void forward(){
digitalWrite(ENA,HIGH); //enable L298n A channel
digitalWrite(ENB,HIGH); //enable L298n B channel
digitalWrite(IN1,HIGH); //set IN1 hight level
digitalWrite(IN2,LOW); //set IN2 low level
digitalWrite(IN3,LOW); //set IN3 low level
digitalWrite(IN4,HIGH); //set IN4 hight level
Serial.println("Forward");//send message to serial monitor
}
void right(){
digitalWrite(ENA,HIGH);
digitalWrite(ENB,HIGH);
digitalWrite(IN1,HIGH);
digitalWrite(IN2,LOW);
digitalWrite(IN3,HIGH);
digitalWrite(IN4,LOW);
Serial.println("Right");
}
//Repeat execution
void loop() {
forward(); //go forward
delay(1000);//delay 1000 ms
right();
delay(1000);
forward();
delay(1000);
right(); //turning right
delay(1000);
}
Here is my error message. I'm not sure what the error means.
1) collect2.exe: error: Id returned 1 exit status
2) Error compiling for board Arduino/Genuino Uno
Thank you
c++ arduino robot
add a comment |
I've just started trying to program this Elegoo Car robot it. Elegoo Car Kit on Amazon
I am able to load programs no problem from examples that are provided. I am trying to get this robot to drive in a square. Here is my code.
//www.elegoo.com
// The direction of the car's movement
// ENA ENB IN1 IN2 IN3 IN4 Description
// HIGH HIGH HIGH LOW LOW HIGH Car is runing forward
// HIGH HIGH LOW HIGH HIGH LOW Car is runing back
// HIGH HIGH LOW HIGH LOW HIGH Car is turning left
// HIGH HIGH HIGH LOW HIGH LOW Car is turning right
// HIGH HIGH LOW LOW LOW LOW Car is stoped
// HIGH HIGH HIGH HIGH HIGH HIGH Car is stoped
// LOW LOW N/A N/A N/A N/A Car is stoped
//define L298n module IO Pin
#define ENA 5
#define ENB 6
#define IN1 7
#define IN2 8
#define IN3 9
#define IN4 11
void forward(){
digitalWrite(ENA,HIGH); //enable L298n A channel
digitalWrite(ENB,HIGH); //enable L298n B channel
digitalWrite(IN1,HIGH); //set IN1 hight level
digitalWrite(IN2,LOW); //set IN2 low level
digitalWrite(IN3,LOW); //set IN3 low level
digitalWrite(IN4,HIGH); //set IN4 hight level
Serial.println("Forward");//send message to serial monitor
}
void right(){
digitalWrite(ENA,HIGH);
digitalWrite(ENB,HIGH);
digitalWrite(IN1,HIGH);
digitalWrite(IN2,LOW);
digitalWrite(IN3,HIGH);
digitalWrite(IN4,LOW);
Serial.println("Right");
}
//Repeat execution
void loop() {
forward(); //go forward
delay(1000);//delay 1000 ms
right();
delay(1000);
forward();
delay(1000);
right(); //turning right
delay(1000);
}
Here is my error message. I'm not sure what the error means.
1) collect2.exe: error: Id returned 1 exit status
2) Error compiling for board Arduino/Genuino Uno
Thank you
c++ arduino robot
I don't know much about Arduino Coding, but I believe you forgotvoid setup()
– Xion
Dec 27 '18 at 17:00
I think that fixed it. Thank you.
– Rick Weinberg
Dec 27 '18 at 17:46
add a comment |
I've just started trying to program this Elegoo Car robot it. Elegoo Car Kit on Amazon
I am able to load programs no problem from examples that are provided. I am trying to get this robot to drive in a square. Here is my code.
//www.elegoo.com
// The direction of the car's movement
// ENA ENB IN1 IN2 IN3 IN4 Description
// HIGH HIGH HIGH LOW LOW HIGH Car is runing forward
// HIGH HIGH LOW HIGH HIGH LOW Car is runing back
// HIGH HIGH LOW HIGH LOW HIGH Car is turning left
// HIGH HIGH HIGH LOW HIGH LOW Car is turning right
// HIGH HIGH LOW LOW LOW LOW Car is stoped
// HIGH HIGH HIGH HIGH HIGH HIGH Car is stoped
// LOW LOW N/A N/A N/A N/A Car is stoped
//define L298n module IO Pin
#define ENA 5
#define ENB 6
#define IN1 7
#define IN2 8
#define IN3 9
#define IN4 11
void forward(){
digitalWrite(ENA,HIGH); //enable L298n A channel
digitalWrite(ENB,HIGH); //enable L298n B channel
digitalWrite(IN1,HIGH); //set IN1 hight level
digitalWrite(IN2,LOW); //set IN2 low level
digitalWrite(IN3,LOW); //set IN3 low level
digitalWrite(IN4,HIGH); //set IN4 hight level
Serial.println("Forward");//send message to serial monitor
}
void right(){
digitalWrite(ENA,HIGH);
digitalWrite(ENB,HIGH);
digitalWrite(IN1,HIGH);
digitalWrite(IN2,LOW);
digitalWrite(IN3,HIGH);
digitalWrite(IN4,LOW);
Serial.println("Right");
}
//Repeat execution
void loop() {
forward(); //go forward
delay(1000);//delay 1000 ms
right();
delay(1000);
forward();
delay(1000);
right(); //turning right
delay(1000);
}
Here is my error message. I'm not sure what the error means.
1) collect2.exe: error: Id returned 1 exit status
2) Error compiling for board Arduino/Genuino Uno
Thank you
c++ arduino robot
I've just started trying to program this Elegoo Car robot it. Elegoo Car Kit on Amazon
I am able to load programs no problem from examples that are provided. I am trying to get this robot to drive in a square. Here is my code.
//www.elegoo.com
// The direction of the car's movement
// ENA ENB IN1 IN2 IN3 IN4 Description
// HIGH HIGH HIGH LOW LOW HIGH Car is runing forward
// HIGH HIGH LOW HIGH HIGH LOW Car is runing back
// HIGH HIGH LOW HIGH LOW HIGH Car is turning left
// HIGH HIGH HIGH LOW HIGH LOW Car is turning right
// HIGH HIGH LOW LOW LOW LOW Car is stoped
// HIGH HIGH HIGH HIGH HIGH HIGH Car is stoped
// LOW LOW N/A N/A N/A N/A Car is stoped
//define L298n module IO Pin
#define ENA 5
#define ENB 6
#define IN1 7
#define IN2 8
#define IN3 9
#define IN4 11
void forward(){
digitalWrite(ENA,HIGH); //enable L298n A channel
digitalWrite(ENB,HIGH); //enable L298n B channel
digitalWrite(IN1,HIGH); //set IN1 hight level
digitalWrite(IN2,LOW); //set IN2 low level
digitalWrite(IN3,LOW); //set IN3 low level
digitalWrite(IN4,HIGH); //set IN4 hight level
Serial.println("Forward");//send message to serial monitor
}
void right(){
digitalWrite(ENA,HIGH);
digitalWrite(ENB,HIGH);
digitalWrite(IN1,HIGH);
digitalWrite(IN2,LOW);
digitalWrite(IN3,HIGH);
digitalWrite(IN4,LOW);
Serial.println("Right");
}
//Repeat execution
void loop() {
forward(); //go forward
delay(1000);//delay 1000 ms
right();
delay(1000);
forward();
delay(1000);
right(); //turning right
delay(1000);
}
Here is my error message. I'm not sure what the error means.
1) collect2.exe: error: Id returned 1 exit status
2) Error compiling for board Arduino/Genuino Uno
Thank you
c++ arduino robot
c++ arduino robot
asked Dec 27 '18 at 16:49


Rick Weinberg
23
23
I don't know much about Arduino Coding, but I believe you forgotvoid setup()
– Xion
Dec 27 '18 at 17:00
I think that fixed it. Thank you.
– Rick Weinberg
Dec 27 '18 at 17:46
add a comment |
I don't know much about Arduino Coding, but I believe you forgotvoid setup()
– Xion
Dec 27 '18 at 17:00
I think that fixed it. Thank you.
– Rick Weinberg
Dec 27 '18 at 17:46
I don't know much about Arduino Coding, but I believe you forgot
void setup()
– Xion
Dec 27 '18 at 17:00
I don't know much about Arduino Coding, but I believe you forgot
void setup()
– Xion
Dec 27 '18 at 17:00
I think that fixed it. Thank you.
– Rick Weinberg
Dec 27 '18 at 17:46
I think that fixed it. Thank you.
– Rick Weinberg
Dec 27 '18 at 17:46
add a comment |
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53948307%2fprogramming-a-elegoo-robot-with-arduino-1-8-8%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53948307%2fprogramming-a-elegoo-robot-with-arduino-1-8-8%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
76jGMO b 3LUbifV9z,NL5E jUbjq0cQXCLOG4ApXreIZvslx9YK UMDSwnCSFMwHUlMAzKnWiQcOhZk1RN8oSjLY0J7k3gzM,HGT6vw
I don't know much about Arduino Coding, but I believe you forgot
void setup()
– Xion
Dec 27 '18 at 17:00
I think that fixed it. Thank you.
– Rick Weinberg
Dec 27 '18 at 17:46