Page 1 of 1

Wanted: A StepDuino sketch written

Posted: Thu Aug 20, 2015 11:14 am
by Ray_M
Wanted (to save learning the Arduino programming language):

Someone to write a StepDuino sketch that will read serial input I can provide of "C" or A" (for Clockwise or anti-clockwise direction for the 2 stepper motors attached to my StepDuino board).

Like this:

If input = 'C1'
Instruction "Move Stepper1 10 steps Clockwise"

If input = 'A1'
Instruction "Move Stepper1 10 steps Anti-clockwise"
-----

If input = 'C2'
Instruction "Move Stepper2 10 steps Clockwise"

If input = 'A2'
Instruction "Move Stepper2 10 steps Anti-clockwise"

Re: Wanted: A StepDuino sketch written

Posted: Fri Aug 21, 2015 5:57 am
by andrew
To give you a starting point, have a look at Serial.available:
https://www.arduino.cc/en/Tutorial/Dimmer
This allows the Arduino/Stepduino etc to accept incoming text from the serial monitor, which you can then take action with.
It will be simpler to use single characters at the start for your commands.

Although you may not want to learn the programming language, it is worth doing so to get the most out of your hardware.
We have an excellent book on the topic (and chapter 5 will be most relevant):
http://www.freetronics.com.au/products/arduino-workshop

Re: Wanted: A StepDuino sketch written

Posted: Fri Aug 21, 2015 6:53 am
by Ray_M
Thanks John, but I want this working this weekend and I've spent a week so far and haven't found out how how to get the single character commands (written in VB6) working with the StepDuino code supplied. It works ok on other code I found but I can only get one motor running with that code.

So all I need is code inserted in this StepDuino sample code to read 4 x single characters for Forward/Reverse Motor 1 + 2 ... http://www.freetronics.com.au/pages/ste ... dbIaH14ISU

============ Code to go into the sample sketch above =====
Serial.begin(9600);
}
void loop() {

if (Serial.available())
{
int drukdata = Serial.read();
if (drukdata == ('C')).... THEN.. FWD S1
if (drukdata == ('A')).... THEN...REV S1
if (drukdata == ('D')).... THEN.. FWD S2
if (drukdata == ('B')).... THEN...REV S2

Once 4 codes are working it would be easy to modify.

I only got the StepDuino to run two motors, although I can see how it could be fascinating to become a hobbyist.

Re: Wanted: A StepDuino sketch written

Posted: Fri Aug 21, 2015 10:53 pm
by Ray_M
It's ok and working now.

Re: Wanted: A StepDuino sketch written

Posted: Mon Aug 24, 2015 7:15 am
by angusgr
Hi Ray,

Glad you got it sorted out. Let me know if you experience any more problems.

Angus

Re: Wanted: A StepDuino sketch written

Posted: Tue Aug 25, 2015 1:14 pm
by Ray_M
Thanks. I had it working for a day and now only the Stepper 2 works.

I really need the proper code to run it an I'm surprised there seems to be nothing on the net showing how.

EDIT: Now Stepper 1 is working again after I minimally altered its potentiometer, so it's ok again. :D .