Was wonder if there are any sketchs for "Knob controlled Stepper utilizing Ada's motor driver shield?
Bill
Ada's Drv board
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- Franklin97355
- Posts: 23911
- Joined: Mon Apr 21, 2008 2:33 pm
Re: Ada's Drv board
and where did you find that reference?Knob controlled Stepper utilizing Ada's motor driver shield
- philba
- Posts: 387
- Joined: Mon Dec 19, 2011 6:59 pm
Re: Ada's Drv board
I think he is talking about this one http://arduino.cc/en/Tutorial/MotorKnob and wants to use a driver board instead of a darlington array. The question could have had more detail and a pointer to the page. Sometimes it seems that people expect clairvoyance.
-
- Posts: 13
- Joined: Wed Oct 19, 2011 5:14 am
Re: Ada's Drv board
What the Hell to you mean "people expect clairvoyance" The question was very plain and simple....
"Sketch for Knob controlled Stepper utilizing Ada's motor driver shield"
What else does one need...
Hmmm
1.UNO... Blue in color
2. ADAfruit Driver Board
3. Potentiometer 10K120 AC to 9VDC rated 1000mA
4. Hookup wire- various color and lengths
5. Power supply for Driver board
6 USB patch cord
7..........
Jeees ???
"Sketch for Knob controlled Stepper utilizing Ada's motor driver shield"
What else does one need...
Hmmm
1.UNO... Blue in color
2. ADAfruit Driver Board
3. Potentiometer 10K120 AC to 9VDC rated 1000mA
4. Hookup wire- various color and lengths
5. Power supply for Driver board
6 USB patch cord
7..........
Jeees ???
-
- Posts: 1645
- Joined: Sat Nov 10, 2007 12:59 am
Re: Ada's Drv board
at first i figured you meant a rotary encoder, but then i thought maybe a knob on the motor shaft with the arduino measuring voltage and frequency and using the motor driver to generate a/c to drive some e/l wire with a transformer to step up the voltage.
hmmm, now there's a stupid idea it might be fun to try.
anyways, i don't know of any sketches offhand, but you could read the pot and get your value from 0 to 511, (or 0 to 1023), and scale it to set a delay between steps.
hmmm, now there's a stupid idea it might be fun to try.
anyways, i don't know of any sketches offhand, but you could read the pot and get your value from 0 to 511, (or 0 to 1023), and scale it to set a delay between steps.
-
- Posts: 13
- Joined: Wed Oct 19, 2011 5:14 am
Re: Ada's Drv board
Hi mtbf0
I ended up working on my own with the help of the net. Another fellow had worked up a sketch that was close to what i wanted to do. I tweaked it a little and ended with the inserted code.
Sorry for the misunderstanding....
I have since added a second Step motor to the mix tha is controlled by the same 10K Pot
Bill
I ended up working on my own with the help of the net. Another fellow had worked up a sketch that was close to what i wanted to do. I tweaked it a little and ended with the inserted code.
Sorry for the misunderstanding....
I have since added a second Step motor to the mix tha is controlled by the same 10K Pot
Bill
Code: Select all
/*
Motor knob using Adafruit MotorShield
Scope : Have a Stepper motor be controlled by a 10K potentiometer
Reads the analog input of a pot and divdes it by 10 to a range between
0 to 101. The potentiometer uses the value to turn the stepper forward or backward.
The circuit:
* pot is connected to analog pin A0.
Center pin of Pontentiometer(wiper) to A0, side pins to +5V*(+3)*and GND.
* Stepper is connected to port 2 of the shield.
created 22 Dec. 2010
by Brandon Honeycutt
Modified by Bill Williams, Jan. 17, 2012
This example code is public domain.
*/
#include <AFMotor.h>
AF_Stepper motor(200, 2); //Stepper motor steps, adjust to the motor
// the previous value from analog input
int current = 0;
int diff = 0;
void setup() {
// initialize serial comms
Serial.begin(9600);
// set motor speed in rpm
motor.setSpeed(50);
}
void loop() {
// get the sensor value
int val = analogRead(0)/10; //divide value by 10
diff = abs(current - val);
//move forward or backward
if(val > current){
motor.step(diff, FORWARD, SINGLE ); // need to test DOUBLE, INTERLEAVE, MICROSTEP, SINGLE
motor.release();
}
else if (val < current){
motor.step(diff, BACKWARD, SINGLE ); // need to test DOUBLE, INTERLEAVE, MICROSTEP, SINGLE
motor.release();
}
// set previous value for next turn
current = val;
// print value of the pot to serial
Serial.print("potentiometer = ");
Serial.print(val);
Serial.print("\n");
// delay 10 millisecs
delay(10);
}
- philba
- Posts: 387
- Joined: Mon Dec 19, 2011 6:59 pm
Re: Ada's Drv board
Hmmm, touched a nerve?
Think about your original question. You can't expect people to understand your context. what's a knob? literally it could be connected to anything and you gave no clue to what that could be. Since you failed to say potentiometer in your post, one was left to guess. I think most people simply ignore the question at that point. The quality of the answers you get are directly proportional to the quality of your question.
Think about your original question. You can't expect people to understand your context. what's a knob? literally it could be connected to anything and you gave no clue to what that could be. Since you failed to say potentiometer in your post, one was left to guess. I think most people simply ignore the question at that point. The quality of the answers you get are directly proportional to the quality of your question.
Please be positive and constructive with your questions and comments.