Hi,
I'm a mechanical engineering student trying to control a stepper motor. I have got it working (arduino uno, PBL3717a driver) and can run the example code working with my motor.
/*
Stepper Motor Control - one revolution
This program drives a unipolar or bipolar stepper motor.
The motor is attached to digital pins 8 - 11 of the Arduino.
The motor should revolve one revolution in one direction, then
one revolution in the other direction.
Created 11 Mar. 2007
Modified 30 Nov. 2009
by Tom Igoe
*/
#include <Stepper.h>
const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(60);
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
// step one revolution in one direction:
Serial.println("clockwise");
myStepper.step(stepsPerRevolution);
delay(500);
// step one revolution in the other direction:
Serial.println("counterclockwise");
myStepper.step(-stepsPerRevolution);
delay(500);
}
Now what i am trying to do is control the steps of the motor using a button in excel. I have a table of positions in my spreadsheet and i can make it calculate how many steps are required to move to the new desired position (based on where it was last etc).
The idea is, on excel you type in the location you want and press a "go" button, excel calculates what the motor needs to do then sends the calculated steps to the motor via the COM 3 port. I have searched online and there are strong suggestions that this is possible, but i am at a loss on how to actually go forward with this. I can use a bit of VB (beginner level but i do get it) and i managed to make a driver board and i have 3d printed a bunch of stuff to create a test rig.
I would be extremely grateful if anyone could help, my current google searches keep leading to guides on extracting info from an arduino to excel, whereas i want to send data from excel to the Uno.
If there is any more info you guys need, let me know