Adressig of shields

For adafruit, I have to address the shields before stacking and soldering them. I am told to solder shield 0 and shield 1 in various ways. Is shield 0 the shield that is the lowest motor shield to be put on the arduino uno, or is that shield 1?

What shields are you using?

Weedpharma

weedpharma: What shields are you using?

Weedpharma

adafruit motor shields

No, you don't understand, you have to say exactly which shield, by adding a link to the page for it, for all you know Adafruit sell several motor shields, or have done several versions - we need to know exactly which one and all its details - that's for you to make easy for us to discover...

MarkT: No, you don't understand, you have to say exactly which shield, by adding a link to the page for it, for all you know Adafruit sell several motor shields, or have done several versions - we need to know exactly which one and all its details - that's for you to make easy for us to discover...

https://learn.adafruit.com/adafruit-motor-shield-v2-for-arduino/install-software

I have now soldered this shield, soldering headers, but it doesn't seem to be powering on? Why is this?

I have soldered the headers to my adafruit board, and connected to the uno both with working battery, and USB cable, yet it still doesn't work, and the green light still doesn't turn on when it is plugged in completely. What is the reasoning behind this?

You have a multimeter? If so check that the right supply voltages are getting to the board in the right places. A multimeter is your eyes...

What have you connected to the shield? What motors? (Please provide a link.)

How are the jumpers set. Which program are you using? (Please provide a link.)

Which Arduino board are you using?

(All these things should have been mentioned in the top post.)

Common topics merged.

I managed to get Adafruit motorshields working for one motor, but I would like it to work for multiple motors. Can anyone tell me what programming has to be done to allow this?

leoelaych: I managed to get Adafruit motorshields working for one motor, but I would like it to work for multiple motors. Can anyone tell me what programming has to be done to allow this?

I thought it would be better to reply to this thread instead of using the new one.

DuaneDegn: What have you connected to the shield? What motors? (Please provide a link.)

How are the jumpers set. Which program are you using? (Please provide a link.)

Which Arduino board are you using?

(All these things should have been mentioned in the top post.)

It strikes me as rude to just abandon this thread and ask the same sort of question on another one without answering questions asked here.

DuaneDegn: I thought it would be better to reply to this thread instead of using the new one.

It strikes me as rude to just abandon this thread and ask the same sort of question on another one without answering questions asked here.

I put on the Vin jumper, so the shield works now. However, only one DC motor moves when I attach 2 to it. I use a DC motor party program, and Uno board with Adafruit Shield. I want to know what adustments are to be made to the programme for 2, 4 or 5 motors?

One of the examples given with the library is called StackingTest. Go try it.

I have adjusted the DC motor party code like this for it to work with 2 motors:
/*
This is a test sketch for the Adafruit assembled Motor Shield for Arduino v2
It won’t work with v1.x motor shields! Only for the v2’s with built in PWM
control

For use with the Adafruit Motor Shield v2
----> http://www.adafruit.com/products/1438
*/

#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include “utility/Adafruit_PWMServoDriver.h”

// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61);

// Select which ‘port’ M1, M2, M3 or M4. In this case, M1, M2
Adafruit_DCMotor *motor_1 = AFMS.getMotor(1);
// You can also make another motor on port M2
Adafruit_DCMotor *motor_2 = AFMS.getMotor(2);

void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println(“Adafruit Motorshield v2 - DC Motor test!”);

AFMS.begin(); // create with the default frequency 1.6KHz
//AFMS.begin(1000); // OR with a different frequency, say 1KHz

// Set the speed to start, from 0 (off) to 255 (max speed)
motor_1->setSpeed(150);
motor_1->run(FORWARD);
// turn on motor
motor_1->run(RELEASE);
motor_2->setSpeed(150);
motor_2->run(FORWARD);
//turn on motor
motor_2->run(RELEASE)
}

void loop() {
uint8_t i;

Serial.print(“tick”);

motor_1->run(FORWARD);
for (i=0; i<255; i++) {
motor_1->setSpeed(i);
delay(10);
}
for (i=255; i!=0; i–) {
motor_1->setSpeed(i);
delay(10);
}
motor_2->run(FORWARD);
for (i=0; i<255; i++) {
motor_2->setSpeed(i);
delay(10);
}
for (i=255; i!=0; i–) {
motor_2->setSpeed(i);
delay(10);
}
Serial.print(“tock”);

motor_1->run(BACKWARD);
for (i=0; i<255; i++) {
motor_1->setSpeed(i);
delay(10);
}
for (i=255; i!=0; i–) {
motor_1->setSpeed(i);
delay(10);
}

Serial.print(“tech”);
motor_1->run(RELEASE);
delay(1000);
}
motor_2->run(BACKWARD);
for (i=0; i<255; i++) {
motor_2->setSpeed(i);
delay(10);
}
for (i=255; i!=0; i–) {
motor_2->setSpeed(i);
delay(10);
}

Serial.print(“tech”);
motor_2->run(RELEASE);
delay(1000);
}
but at present it does not and has the error messages

DCMotorTest.ino: In function ‘void setup()’:
DCMotorTest.ino:40:1: error: expected ‘;’ before ‘}’ token
DCMotorTest.ino: At global scope:
DCMotorTest.ino:81:1: error: ‘motor_2’ does not name a type
DCMotorTest.ino:82:3: error: expected unqualified-id before ‘for’
DCMotorTest.ino:82:13: error: ‘i’ does not name a type
DCMotorTest.ino:82:20: error: ‘i’ does not name a type
DCMotorTest.ino:86:3: error: expected unqualified-id before ‘for’
DCMotorTest.ino:86:15: error: ‘i’ does not name a type
DCMotorTest.ino:86:21: error: ‘i’ does not name a type
DCMotorTest.ino:91:3: error: ‘Serial’ does not name a type
DCMotorTest.ino:92:3: error: ‘motor_2’ does not name a type
DCMotorTest.ino:93:8: error: expected constructor, destructor, or type conversion before ‘(’ token
DCMotorTest.ino:94:1: error: expected declaration before ‘}’ token
expected ‘;’ before ‘}’ token

Can someone explain how this problem needs to be rectified for port M" to work with port M1?

leoelaych: motor_2->run(RELEASE)

DCMotorTest.ino:40:1: error: expected ';' before '}' token

Here's one of your errors.

Please read "How to use this forum" sticky and learn to use code tags.

Please put your code in its own window as seen in other posts. This can be done by placing     [code]  and [/code]  around the code or use the </> icon. This makes it easier for others to read.

Weedpharma