Code needs double checking

I'm writing a (at least for my skill level) complicated code for a school assignment and am having a few problems which are difficult to fix on my own. The most important thing is finding syntax errors, logic errors are difficult to spot anyway without knowing the full context of the code

#include <Stepper.h>

#include <Servo.h>


the value "123" is used as a placeholder for values which aren't clear yet (because the steps aren't all physically built yet)

the condition "x=1" is used as a placeholder for if and while functions where the exact condition required isn't clear yet (because the steps aren't all physically built yet)
//names the pins appropriately
byte = 5;
byte = 6;

Servo marble_ser; //declares the servo used to push over a marble for the first step
Servo bottle_ser; //declares the servo used to push over a bottle in the second step

const int stepsPerRevolution = 4; //declares the number of steps per revolution used by stepper motors
const int rolePerMinute = 123; //declares the number of rounds per minute used by stepper motors
Stepper pusher_limb(stepsPerRevolution, 8, 10, 9, 11); //initialize <Stepper.h> on pins 8-11

void setup() {

//attaches marble_ser to pin 5 and bottle_ser to pin 6


void loop() {

marble_ser.write(180); //marble_ser rotates 180 degrees, pushing the marble down a slope

//if the water level sensor senses something, pusher_limb will rotate 180 degrees to push a button
pusher_limb.step(stepsPerRevolution / 2);


First thing is, you can't use a period (.) in a variable name as you have here:

byte = 5;

Hi, @thdfx

Please read the post at the start of any forum , entitled "How to use this Forum".

Your if statement


should be.


Easily done, the == means just do a comparison, = means make x equal to 1.

Tom... :grinning: :+1: :coffee: :australia:

i believe the last error is that x is not defined.

but what is x and how is its value set?

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