Pages: [1]   Go Down
Author Topic: Output Pins.  (Read 873 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 30
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, I'm a beginner to the arduino and the coding. I want to build this robot posted here at http://arduino.cc/forum/index.php/topic,90809.0.html but I want to know how to set the outputs he listed to the output pins for my motor shield. The motor shield I will be receiving is http://dx.com/p/arduino-compatible-2-channel-relay-shield-module-138600?item=1 . Can anyone please help me. I'm a total noob when it comes to this. Please reply!
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26312
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you worked through any of the examples provided with the IDE?
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

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

Not really, I just started working on some projects that seemed simple to me. I just want to know how the output pins are set in the sketch provided. I understand everything else to it.
Logged

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

It's just this part.
Code:
      int i;
    for(i=5;i<=8;i++)     //For Arduino Motor Shield
    pinMode(i, OUTPUT);    //set pin 4,5,6,7 to output mode

How do I change the output pins to something else like 13, 12, 11, 3.
Logged

Fort Lauderdale, FL
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The for() loop is an easy way to set the pins from 5,6,7 (not sure why the comment is wrong) to OUTPUT.

Hint, it would be the same as doing:
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.c

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

Ahh, so I just remove what I've listed above and use the separate regular pinMode thing? Makes a lot of sense now. Thank you very much!
Logged

Pages: [1]   Go Up
Jump to: