Go Down

Topic: Motor Shield R3 (Read 2950 times) previous topic - next topic

boshafouad

Hi,. ...
       
i can't fined the program of  Motor Shield R3 in arduino-1.0.6 ???
i want him to move the libraries pleas i want help ?

Grumpy_Mike

Have you seen this:-
http://arduino.cc/en/Main/ArduinoMotorShieldR3

You do not need a library to drive this, you just put the appropriate pins high or low. 

boshafouad

Have you seen this:-
http://arduino.cc/en/Main/ArduinoMotorShieldR3

You do not need a library to drive this, you just put the appropriate pins high or low. 
i with u .... but this error  i don't know why show ???

  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Arduino: 1.0.6 (Windows 7), Board: "Arduino Uno"
sketch_nov12a:9: error: 'MotorShieldR3' does not name a type
sketch_nov12a.ino: In function 'void loop()':
sketch_nov12a:35: error: 'yellowCar' was not declared in this scope
sketch_nov12a:103: error: 'yellowCar' was not declared in this scope

Grumpy_Mike

Quote
i don't know why show
No, no one can know until you post your code.

boshafouad

#4
Nov 12, 2014, 08:20 pm Last Edit: Nov 12, 2014, 08:22 pm by boshafouad
and this is program

Grumpy_Mike

No you do not post code like that, it comes out looking like this:-
Code: [Select]

void setup()
{ † † †
†Serial.begin(9600); †//Set the baud rate to that of your Bluetooth module.
†pinMode(pinfrontLights , OUTPUT);
†pinMode(pinbackLights , OUTPUT);
}

void loop(){
†if(Serial.available() > 0){
† †timer1 = millis(); †
† †prevCommand = command;
† †command = Serial.read();
† †//Change pin mode only if new command is different from previous. †
† †if(command!=prevCommand){
† † †//Serial.println(command);
† † †switch(command){
† † †case 'F': †


That will never compile.

Take you .pde file and zip it up and then attache it.

boshafouad

No you do not post code like that, it comes out looking like this:-
Code: [Select]

void setup()
{ † † †
†Serial.begin(9600); †//Set the baud rate to that of your Bluetooth module.
†pinMode(pinfrontLights , OUTPUT);
†pinMode(pinbackLights , OUTPUT);
}

void loop(){
†if(Serial.available() > 0){
† †timer1 = millis(); †
† †prevCommand = command;
† †command = Serial.read();
† †//Change pin mode only if new command is different from previous. †
† †if(command!=prevCommand){
† † †//Serial.println(command);
† † †switch(command){
† † †case 'F': †


That will never compile.

Take you .pde file and zip it up and then attache it.
this i write before the program

Grumpy_Mike

#7
Nov 12, 2014, 09:26 pm Last Edit: Nov 12, 2014, 09:29 pm by Grumpy_Mike
Quote
this i write before the program
Sorry no idea what that means.

Just use the pins to control the motor. Here is an example of initialising the motor's pins.

Code: [Select]

// these are the pins connected to the Arduino Motor Shield:
const int pwmA = 3;
const int brakeA = 9;
const int dirA = 12;
const int pwmB = 11;
const int brakeB = 8;
const int dirB = 13;
/*
Initialize the stepper library using the direction pins (dirA and dirB)
to control the motor shield.
*/

void setup () {
// set up all of the pins of the motor shield as outputs:
pinMode(brakeA, OUTPUT);
pinMode(dirA, OUTPUT);
pinMode(brakeB, OUTPUT);
pinMode(dirB, OUTPUT);
// set the brake pins LOW to turn them off:
digitalWrite(brakeA, LOW);
digitalWrite(brakeB, LOW);
}

When you want the motor to move, remove the break and do an analogWrite to the pwm pin for the motor.

dafo85

Hi everyone.

I have a problem with the arduino motor shield rev3.

I connected it to an Arduino UNO without stacking it, I use cables from the outputs. I did this because I need to control 6 motors and I have 3 arduino motor shields, if I stack all of them they will not work.

I am using 9v batteries, one to power on the UNO and another for the motor shield.

The problem I have is that motor shield output A is running slower than output B, but it only happens in the forward direction, in backward direction both outputs speeds is the same.

Any suggestion?

Thanks

Grumpy_Mike

Quote
Any suggestion?
Start your own thread.

Go Up