Pages: 1 [2]   Go Down
Author Topic: DC motor  (Read 2738 times)
0 Members and 1 Guest are viewing this topic.
Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 601
Posts: 48554
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
const int analogInPin = A0;
A0 is the value to use when using an analog pin (pin 0) as a digital pin. Stupid ass addition to WProgram.h, if you ask me.

You want to use 0, not A0.

Code:
   analogWrite(analogOut, LOW);
Pin 4 is not a PWM pin, so you can't use analogWrite to write to that pin.

What happens when sensor value IS 512?
Logged

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

OK Thanks !! that made it work but now how do I get it to run faster each way?
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 601
Posts: 48554
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
that made it work but now how do I get it to run faster each way?
Make what run faster? The code? Or the motor?
Logged

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

I mean the motor  I would like to make it stand still when the pot. is in the middle and then spin faster each way when I turn the potentiometer.
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 601
Posts: 48554
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Try re-reading Reply #7. You were on the right track.
Logged

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

thanks for your help but I think i've burned my arduino becouse the atmel chip is getting hot when I plug it in to the usb. dont't really what I did wrong:D so will have to get a new one, i think.
Logged

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

Hi !!!

I'm back an I have a new chip smiley-grin.
And I'm also making a cnc mill and I've got a new driver for the stepper the Leadshine dm856 I'm waiting and looking for other parts so i have time to play. smiley

so now I have found on this treat:http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1261516343/15

a code that makes it go faster now I'll try to make that What I wanted so that it spins both ways.

any suggestions ??

thanks in advance.
Logged

Pages: 1 [2]   Go Up
Jump to: