Hi,
Does that mean you have now been able to upload your code?
Where you trying to upload with all the other hardware connected?
Can you please post a circuit diagram, including power supply?
You should be able to post your code like this;
#define HALL_SENSOR 3
#define DIR 10
#define STEP 11
// Direction Variable
boolean setdir = LOW;
void homefunction() {
// Set motor speed pulse duration
int pd = 4000;
// Move motor until home position reached
while (digitalRead(HALL_SENSOR) == 1) {
digitalWrite(DIR, setdir);
digitalWrite(STEP, HIGH);
delayMicroseconds(pd);
digitalWrite(STEP, LOW);
delayMicroseconds(pd);
}
}
void setup() {
// Setup the stepper controller pins as Outputs
pinMode(DIR, OUTPUT);
pinMode(STEP, OUTPUT);
// Setup the Hall Effect switch as an Input
pinMode(HALL_SENSOR, INPUT);
// Home the motor
homefunction();
}
void loop() {
}
To add code please click this link;
Tom...