Arduino Bluetooth with Stepper

Hello,
I'm working on a project and want to connect 2 Stepper nema 17 with my bluetooth HM-10 device. I setted it up and it work with the standart code. Now I want to connect them and need to have 3 stages. One where it turns clockwise, one where it turns counterclockwise and one where it doesnt turn at all. I think I setted it up like this and it might work(exept the ''doesnt turn'' part), but I dindnt had a chance to test it, because its a school project. Anyway here is the code can please someone please check it , make sure it works and add the ''doesnt turn part.
Thank yall very much.

# include "SoftwareSerial.h"
#include <Stepper.h>

SoftwareSerial BTSerial(2, 3);
  Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
  const int stepsPerRevolution = 200;
  char btDaten;


  void setup()
  {
  BTSerial.begin(9600);
  Serial.begin(9600);
  while (!Serial) {;}
  myStepper.setSpeed(60);
  Serial.println("2 -> forward");
  Serial.println("1 -> back");
  Serial.println("0 -> Stopp");
  }
  void loop()
  {
  btDaten = BTSerial.read();
  if (btDaten == '2')
  {
  BTSerial.print("forward");
  Serial.println("clockwise");
  myStepper.step(stepsPerRevolution);
  }
  else if (btDaten == '1')
  {
  BTSerial.print("back"); ;
  Serial.println("counterclockwise");
  myStepper.step(-stepsPerRevolution);
  }
  else(btDaten==’0’)
   {
  Serial.println("nomovement");
  myStepper.step( //here it has to go
  }
  }

Please edit your post, select all code and click the <code/> button. Next save the post. It will make the code easier to read, easier to copy and the forum software will not see it as formatting instructions. This is in accordance with How to get the best out of this forum (please read it (again?)).

Your topic seems unrelated to the category where you have posted and hence has been moved.

thanks man Im sorry I didnt knew how to do that and also didnt find a ''project gudiance topic''. Thanks

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.