Pages: [1]   Go Down
Author Topic: stop() functio  (Read 1344 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello!

I'm new in Arduino and need your advice.

I'd built my first bot. This is tank-like platform controlled by two motors.
For controlling I have functions like

void forward();
void left();
void right();
void stop();
and so on.

When I do something like

  stop();
  forward();
  delay(5000);
  
  stop();
  left();  
  stop();
  
  forward();
  delay(5000);

this doesn't work as expected.
But when I rename stop() to stopMotors() it runs!

So, is stop() a predefined function?
and if yes, what does it do?

Thanks!
Troll.
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 200
Posts: 12777
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


The only "stop" I can find is in the Ethernet Client library.  Are you using this library?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No. I don't use any libraries.

Any more suggestions?

Thanks.
Logged

Not USA
Offline Offline
Full Member
***
Karma: 1
Posts: 123
Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Is the unexpected behavior that it just drives forward no matter what?

That's what would happen if stop() didnt do anything, but stopmotors() might actually call some code that does something.

does stopmotors() call some kind of delay or something, enabling a left turn and other behaviour?
Logged

3D Artist,Modeler, Texturer, Animator, Electronics and Robotics, Programming C, VB, Website Design, Flash animator

Too many hobbies?

0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It seems to be my problem.
Because when I give full power to motors, motor driver halts often. When I'm using PWM to start moving robot, it works well.

So it not a problem with stop() function. It may be a problem with high initial current for motors  smiley

Thanks for replies smiley
Logged

Pages: [1]   Go Up
Jump to: