Stepper Motor controlled from Android, the android app created using MIT app inventor. This app will only work for Easydriver for stepper motor, other stepper control will not work with this app.
Arduino code for controlling stepper motor from android app:
-------------------------------------------------------------------------------------------------------------------------------
#include <AccelStepper.h>
AccelStepper stepper(AccelStepper::FULL2WIRE, 8, 9);
int spd = 1000; // The current speed in steps/second
int sign = 1; // Either 1, 0 or -1
void setup()
{
Serial.begin(9600);
stepper.setMaxSpeed(1000);
stepper.setSpeed(1000);
}
void loop()
{
char c;
if(Serial.available()) {
c = Serial.read();
if (c == 'f') { // forward
sign = 1;
}
if (c == 'r') { // reverse
sign = -1;
}
if (c == 's') { // stop
sign = 0;
}
if (c == '1') { // super slow
spd = 10;
}
if (c == '2') { // slow
spd = 100;
}
if (c == '3') { // medium
spd = 300;
}
if (c == '4') { // Fast
spd = 500;
}
if (c == '5') { // medium
spd = 700;
}
if (c == '6') { // medium
spd = 1000;
}
stepper.setSpeed(sign * spd);
}
stepper.runSpeed();
}
------------------------------------------------------------------------------------------------------------------------------
Android app link click here
-------------------------------------------------------------------------------------------------------------------------------
MIT app inventor blocks:
Hi I have built this and it works quite well. There is some hesitation in the motor at slow speed which can be a problem. Will you be including a link to the source code as it would be nice to have a wider gap between direction and speed buttons?
ReplyDeleteMany thanks for the app I use it to focus my telescope.
Hi what source code you are talking about??
Deleteaccelstepper.h
ReplyDeleteso we have to add a library for it in arduino uno?
Great program. Thanks for letting me know of MIT app.
ReplyDeletewe make is work, but i want make with limit switch..
ReplyDeletehow make code ??
We tried to repicate it but we are having some trouble as it is not controlling via bluetooth
ReplyDelete