mtzzzz
October 28, 2021, 4:06am
1
is this full coding or not? step1() and step2() errors...idk why and how to fix them...can anybody help me? it supposed to be like this video
please help me!!!
below is the coding
#include <Stepper.h>
#define steps 256
const int buttonPin = 2;
const int buttonPin2 = 3;
const int stepsPerRevolution = 200;
int buttonState = 0;
int buttonState2 = 0;
int LED1 = A0;
int LED2 = A1;
Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);
void loop()
{
buttonState = digitalRead(buttonPin);
if (buttonState == HIGH)
{
analogWrite(LED1,255);
steps1();
analogWrite(LED1,0);
analogWrite(LED2,255);
}
else
{
delay(10);
}
buttonState2 = digitalRead(buttonPin2);
if (buttonState2 == HIGH)
{
analogWrite(LED2,0);
analogWrite(LED1,255);
step2();
analogWrite(LED1,0);
}
else
{
delay(10);
}
}
It is not complete code.
steps1() and step2() are calls to functions which do not exist in the code. This results in errors and failure to compile.
See this documentation on functions.
https://www.arduino.cc/en/Reference/FunctionDeclaration
My guess is that the two missing functions are somewhere in the video you linked, and you did not add them to the code you posted.
mtzzzz:
below is the coding
Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'
Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination
Hello,
Welcome to the Arduino Forum.
This guide explains how to get the best out of this forum. Please read and follow the instructions below.
Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is frustrating for you and frustrating for us.
The people who try to help with your pro…
system
Closed
April 26, 2022, 7:01am
4
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.