Pages: 1 [2]   Go Down
Author Topic: Programming Scrolling Question  (Read 743 times)
0 Members and 1 Guest are viewing this topic.
Indiana, US
Offline Offline
Full Member
***
Karma: 12
Posts: 204
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

How are you powering the motors?  One common mistake is to power them from the Arduino board.  They'll need their own power supply or battery pack (always connect the grounds together).

It sounds like you might be drawing too much power when you put load on the motors.  This makes the Arduino reboot.
Logged

There are 10 types of people in the world, those that understand binary, and those that don't.

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

Next question (low batteries was the answer to the last one sorry!)

my only thing is that the code is correct but the system doesnt follow it perfectly.  the burst is too high on the wheels (they accelerate too fast too quickly in a way that when it supposed to move straight, it just doesnt...)  how do i lower the speed of the wheels?


object: make motors into a square
current code:

Code:
int motorPin1 = 6;
int motorPin2 = 11;
void setup(){
pinMode (motorPin1, OUTPUT);
pinMode (motorPin2, OUTPUT);
}
void loop(){
  delay (700);
  digitalWrite (motorPin1, HIGH);
  digitalWrite (motorPin2, HIGH);
  delay (100);
  digitalWrite (motorPin1, LOW);
digitalWrite (motorPin2, LOW);
delay(700);
 
digitalWrite (motorPin1, LOW);
digitalWrite (motorPin2, HIGH);
delay(45);
digitalWrite (motorPin1, LOW);
digitalWrite (motorPin2, LOW);
}
Logged

Indiana, US
Offline Offline
Full Member
***
Karma: 12
Posts: 204
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Without knowing how your motors are wired up, I really can't say.  I'm curious, How are they configured, how are you controlling them (outputs driving transistors? a shield?), and how are you powering them (separate batteries?)?

From looking at the code, you are turning them on and off digitally -- full speed on / complete stop.

Alternatively, you can drive them using pulse-width modulation (PWM) and output a lower "voltage" to slow them down.  If you are not sure how, do a quick google on "Arduino PWM" to get what you need.  Its fairly easy to do.

Pat.
« Last Edit: November 25, 2012, 10:06:16 pm by patduino » Logged

There are 10 types of people in the world, those that understand binary, and those that don't.

Pages: 1 [2]   Go Up
Jump to: