Hello good day everyone hopes can help me, copy this code to handle an engine but when I put it to arduino I get this error 'engine' was not declared in this scope
I'll give you the code below
#include <Stepper.h>
//int SPU = 200; // Schritte pro Umdrehung.
//Stepper Motor(SPU, 8,9,10,11);
int i=0;
int x=0;
long Drehzahl=0;
long Richtung=0;
long Dauer=0;
long Stepps=0;
char A=0;
int SPU = 200; // Schritte pro Umdrehung.
Stepper Motor(SPU, 8,9,10,11);
void setup() {
pinMode (A0, INPUT_PULLUP);
pinMode (A1, INPUT_PULLUP);
pinMode (A2, INPUT_PULLUP);
pinMode (A3, INPUT_PULLUP);
pinMode (A4, INPUT_PULLUP);
pinMode (A5, INPUT_PULLUP);
Serial.begin(9600);
motor.setSpeed(10); // 10 rpm
}
void loop()
{
//if (mySerial.available())
Serial.println("Hallo....");
Serial.println("Tipp Dréizahl an.");
while(!Serial.available()>0){}
Drehzahl= Serial.parseInt();
Serial.println("Merci, wéivill Minuten soll den Motor lafen?");
while(!Serial.available()>0){}
Dauer = Serial.parseInt ();
Serial.println("Wat fir eng Dréirichtung? 1 ass fir Steren, 2 ass zréck");
while(!Serial.available()){}
Richtung = Serial.parseInt();
if (Richtung == 1)
{Stepps= 200;}
if (Richtung == 2)
{Stepps= 200;}
Serial.println("OK, Dréizahl ass: ");
Serial.print(Drehzahl);
Serial.print(" Umdréiungen pro Minute. ");
Serial.println("Den Motor läft lo ");
Serial.print(Dauer);
Serial.print(" Minuten lang. ");
int i = 0;
int x = (DauerDrehzahl2);
/*Serial.println(x);
Serial.println(Stepps);
Serial.println(Richtung);
*/
if (Richtung==1)
{
while (i<x)
{
motor.setSpeed(Drehzahl);
motor.step(Stepps, BACKWARD,INTERLEAVE);
i =i+1;
}
}
else if (Richtung==2)
{
while (i<x)
{
motor.stepSpeed(Drehzahl);