Motor Shield V2 Pin 5_trouble

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
xian5v
 
Posts: 16
Joined: Fri Feb 07, 2014 2:01 pm

Motor Shield V2 Pin 5_trouble

Post by xian5v »

Hello,
I Just received the motor shields i ordered. I am trying to soilder the stacker pins I purchase, but pin 5 is already soldered closed. Isthat how they are suppose to be?

thank you

User avatar
adafruit_support_bill
 
Posts: 88142
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor Shield V2 Pin 5_trouble

Post by adafruit_support_bill »

please post a clear photo of the problem.

User avatar
xian5v
 
Posts: 16
Joined: Fri Feb 07, 2014 2:01 pm

Re: Motor Shield V2 Pin 5_trouble

Post by xian5v »

this is a picture of the analog pins.
this is a picture of the analog pins.
motor shield v2.jpg (698.46 KiB) Viewed 376 times
pin 5 is closed. Should it be like that?

thanks

User avatar
adafruit_support_bill
 
Posts: 88142
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor Shield V2 Pin 5_trouble

Post by adafruit_support_bill »

That is unusual. It is an SMT board, so the solder is applied with a stencil.

In any case, it should not be difficult to clear. Some solder wick or a solder sucker will remove it. Or you can just position your header over the hole, heat it up and push it through.

User avatar
xian5v
 
Posts: 16
Joined: Fri Feb 07, 2014 2:01 pm

Re: Motor Shield V2 Pin 5_trouble

Post by xian5v »

thank you. Seemed simply enough, just wanted to make sure.
I ran the DC motor test and works great.
Where do you extend the run time in the Adafruit code? It only runs for a second in each direction?

thanks again;
you guys are rad!

User avatar
adafruit_support_bill
 
Posts: 88142
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor Shield V2 Pin 5_trouble

Post by adafruit_support_bill »

The standard DCMotorTest accelerates for about 2.5 seconds in each direction. This is controlled by the 'delay()' in the 'for' loops.

With a loop count of 255 and a delay of 10 milliseconds, it will take 2550 milliseconds to complete the loop. If you increase the number in the delay() function, it will accelerate slower and run for a longer time.

Code: Select all

void loop() {
  uint8_t i;
  
  Serial.print("tick");

  myMotor->run(FORWARD);
  for (i=0; i<255; i++) {
    myMotor->setSpeed(i);  
    delay(10);
  }
  for (i=255; i!=0; i--) {
    myMotor->setSpeed(i);  
    delay(10);
  }
  
  Serial.print("tock");

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

  Serial.print("tech");
  myMotor->run(RELEASE);
  delay(1000);
}

User avatar
xian5v
 
Posts: 16
Joined: Fri Feb 07, 2014 2:01 pm

Re: Motor Shield V2 Pin 5_trouble

Post by xian5v »

I am also trying to us a limit switch to stop the DC motor. I have used LN298 and wired the limit switch to the directional enable wire. When the motor gets to the top, the enable wire is broken and motor stops immediately. How can I put a switch on the enable pin of the motor shield when it is stacked, or how can I cause it to stop with a limit switch?


thanks!

User avatar
adafruit_support_bill
 
Posts: 88142
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor Shield V2 Pin 5_trouble

Post by adafruit_support_bill »

There is no direct access to the enable pin. You would need to connect your limit switch to a digital pin and write some code to detect when it is closed and stop the motor.

User avatar
xian5v
 
Posts: 16
Joined: Fri Feb 07, 2014 2:01 pm

Re: Motor Shield V2 Pin 5_trouble

Post by xian5v »

I had tried to do that and ran into some inconsistant digital pin readings. Looked up debounce, used arduino code example, that did not work. Not trying to play the newbie card, but I got the impression that debounce is a kinda difficult. Which led me to some forum suggestions the use an RC circuit instead of code. I could not get my debounce code from arduino.cc to do anything but flicker from 01010100011001. Is an RC circuit more reliable?
thank you bi!!

User avatar
adafruit_support_bill
 
Posts: 88142
Joined: Sat Feb 07, 2009 10:11 am

Re: Motor Shield V2 Pin 5_trouble

Post by adafruit_support_bill »

If it is flickering for more than a few milliseconds, bounce is not likely the problem. Sounds more like a floating input. Do you have a pullup resistor?
Post a photo of your connections and the code you are using.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”