Hello, using Movi connected to Mega and a ServoCity Dual Motor Controller for voice activated control of linear actuator, also using stepper motors. Cannot get working (works without Movi triggering) actuator code to work within a Movi Res. Voice portion is recognized by Movi- believe problem is that code within the Res. I suspect that timing might be a problem but I'm quite the ignorant on many fronts. Code snippet below- I pasted the Loop code into Res 1 for the Sample beginner LightSwitch sketch. Any help WAY appreciated!
///////////////
int LeftDistance = 0;
void setup() {
pinMode(10, OUTPUT);// connects to servo signal input to ServoCity dual motor (linear actuator) controller.
}
void loop() {
if (LeftDistance < 20) { //value of 20 gets about 1/4 inch of actuator movement
digitalWrite(10, HIGH);
delayMicroseconds(1000); // 1000 piston goes out; 2000 piston goes in;
digitalWrite(10, LOW);
LeftDistance = LeftDistance + 1;
}
}
mg