Pendulum Balance Robot

HazardsMind:
I think it would be best to start over and do tests to see if it works, and again after each additional code.

Okay, i have gone back and and sorted out the stepper motor, this code was a second attempt, and the bits you mentioned I had forgotten to copy over. So now the motor will now step if commanded.

I'm still struggling to input a 'double*' however, I guess the code ' double int = (something) ' is used, but I am unsure what to put as the something. I guess a similar thing will happen for the variable 'newPosition'? to give a variable that has the double format required by the PID? (and hopefully fixing the encoder reader in the process)