Hello Robin2, thank you very much for replying and sorry about the picture, I've read the guidelines you sent and will follow them through next time.
I'll try and add as much information as I can.
I have been experimenting with the example codes from the Arduino program and this as far as i have gotten.
Stepper motor control
#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);
int stepCount = 0; // number of steps the motor has taken
void setup() {
// declare the motor as an OUTPUT:
Stepper (8 ,9 ,10, 11, OUTPUT);
Serial.begin(9600);
}
void loop() {
myStepper.setSpeed(100);
// step 1/100 of a revolution:
myStepper.step(stepsPerRevolution / 200);
Serial.println("HEY!! HELLO!!");
}
Microphone reading
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
int sensorValue = analogRead(A0);
// print out the value you read:
Serial.println(sensorValue);
delay(1); // delay in between reads for stability
}
How far I have gotten
I have in the last couple of hours been tinkering with example code and found this gem! I think that I have gotten past my initial hurdle...and the motor works with some degree of input from the mic
#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);
int stepCount = 0; // number of steps the motor has taken
void setup() {
// nothing to do inside the setup
}
void loop() {
// read the sensor value:
int sensorReading = analogRead(A0);
// map it to a range from 0 to 100:
int motorSpeed = map(sensorReading, 0, 1023, 0, 100);
// set the motor speed:
if (motorSpeed > 0) {
myStepper.setSpeed(100);
// step 1/100 of a revolution:
myStepper.step(stepsPerRevolution / 200);
}
}
This leads me to ask, how can i gain further control of the motor via volume? for example if it reaches a certain threshold what do i need to code in order to make it turn the other direction?