stepper motor and sensors control program

Hello,

I am working on a project that uses two sensors, one stepper motor(200 steps) using the L298N driver chip. sensor 1 gets high and triggers forward rotation of the stepper, sensor 2 gets high and trigger reverse rotation of the stepper motor. I intend to use 100 pulses in 125ms as motor control speed. i will appreciate any help in writing this program am not very good at programming. Thank you.

If you want to have someone write the code for you, post in the Gigs forum and pay some money. If you post here, people will help you with the code you write. Give it a shot.

Start by getting the Blink example sketch to work

Look and try any/all of the examples in the IDE

Get your stepper motor working (There are stepper motor examples in the IDE)

Get your sensors working (You might want to look at the StateChangeDetection sketch)

Start piecing it all together

When/If you get stuck, post your code, your problem and people will assist. Make sure to read the sticky post at the top of the forum about how to properly post code as it helps people help you.

You know what they say. Give a man a fish he eats for a day. Teach him how to fish ...

Grab youself an arduino board and work trough a couple of example. Start simple with some led blinking and your motor will turn in no time. We all started without knowing anything about programming. :slight_smile:

Start the Arduino IDE goto File -> Example -> 01 Basics

There are many libraries that will help you. Here you can read about stepper motors and how to control them with your arduino.

https://www.arduino.cc/en/Reference/Stepper

If you have any specific issues. Ask again with some code you wrote and everyone will be happy to answer your questions and help you fix some bugs.

Before you start coding are you sure your motor and the 298 are compatible? The 298 was designed to work with the stepper motors of its day, some decades ago. Today's stepper motors require different driving techniques provided by today's drivers.

These links may help
Stepper Motor Basics
Simple Stepper Code

...R