hello
I am a beginner and search software for needle sweep for my car
I have a basic program and works continuously.
it must be adjusted so switched as voltage on pin 2 that the needle
1 booking sweep.
Who can help me?
/*
Stepper Motor Control - one revolution
This program drives a bipolar stepper motor.
The motor is attached to digital pins 3 - 6 of the Arduino.
The motor should revolve one revolution in one direction, then
one revolution in the other direction.
*/
#include <Stepper.h>
const int stepsPerRevolution = 420; // change this to fit the number of steps per revolution
// for your motor
// initialize the stepper library on pins3 through 6:
Stepper myStepper(stepsPerRevolution, 6, 5, 4,3);
void setup() {
// set the speed at 65 rpm:
myStepper.setSpeed(65);
// 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);
}