Wanted: A StepDuino sketch written

The StepDuino is an Arduino Uno compatible board with 2 onboard stepper controllers, a 20x4 LCD, servo outputs, and inputs for travel limit switches or a touchscreen overlay. [Product page]
Post Reply
Ray_M
Posts: 7
Joined: Sat Aug 15, 2015 6:34 am

Wanted: A StepDuino sketch written

Post by Ray_M » Thu Aug 20, 2015 11:14 am

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"

andrew
Freetronics Staff
Freetronics Staff
Posts: 978
Joined: Sun Jul 14, 2013 7:06 am
Location: Melbourne, Australia
Contact:

Re: Wanted: A StepDuino sketch written

Post by andrew » Fri Aug 21, 2015 5:57 am

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

Ray_M
Posts: 7
Joined: Sat Aug 15, 2015 6:34 am

Re: Wanted: A StepDuino sketch written

Post by Ray_M » Fri Aug 21, 2015 6:53 am

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.

Ray_M
Posts: 7
Joined: Sat Aug 15, 2015 6:34 am

Re: Wanted: A StepDuino sketch written

Post by Ray_M » Fri Aug 21, 2015 10:53 pm

It's ok and working now.

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: Wanted: A StepDuino sketch written

Post by angusgr » Mon Aug 24, 2015 7:15 am

Hi Ray,

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

Angus

Ray_M
Posts: 7
Joined: Sat Aug 15, 2015 6:34 am

Re: Wanted: A StepDuino sketch written

Post by Ray_M » Tue Aug 25, 2015 1:14 pm

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 .

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest