Run gShield without using a PC

Hello Robin2,

Thanks for your reply. Your information has been very helpful. I used your Simple Stepper Code example and changed the pins to match the direction and step. I had to add pinMode(8, OUTPUT); digitalWrite(8, LOW); in order to enable the stepper on the gShield. Works great. Step one complete. :slight_smile:

Step two: I was wanting to control two steppers (XY) and make a claw type game for some students. You know, that game where you spend $50 trying to claw an item that costs $5. lol Basically an analog joystick so I can control X and Y. My problem is I'm not sure how to implement the joystick. I am guessing I can do an analog read from from the pin and map it to 1-255 and use 128 for center. If I move joystick to one side, it should step the motor, but not sure how to implement it.

Hardware: MEGA 2560, gShield, Stepper, Power supply

Variable speed would be nice and probably the end goal but for now, I just want the motors to step in the direction.


You have asked a question in an old Thread and I have suggested to the Moderator to move you to a new Thread as your question is about a new project.

This Thread about using a joystick may help - even if only to make it easier to say “no, that’s not what I want” In general I think your joysticks should control the speed and direction of your motors.

For the sort of game you are talking about I’m not sure that stepper motors are any better than simple DC motors.


Thanks Robin2. I'm not trying to make an actual claw game, just something that works like one, using steppers and joystick. The reason I used that as an example was because if you look at an actual claw game, they are using steppers. Or at least the ones I have seen are.

I will check out that thread and see what I can come up with. :slight_smile:

Thanks for the help/ideas.