Wiper motor is continuous using code

Using an 18v15 with DIR and PWM pin I use. I have tried to implement it but it seems that once I turn the wheel the wiper motor just loops around until it stops or blows the 10A fuse we have. So, something is obviously wrong with my code.

I also had the problem of once I flipped the power switch the wiper motor would start turning without doing anything so I implemented the analogWrite(0) in the setup to turn it off. The part of code in question start with /STEERING*

The output of the code display great with the error, turnpos, currentpos. Just the wiper motor, once it starts, it just continues looping instead of only going 30-40 degrees to the left or right from the upright vertical position. The wiper motor shaft is upright, and I want it to turn either left about 30 degrees or right 30 degrees. And if it is all the way left 30 degrees and then go back right. It now acts like it has no max or min and just continuously turns.

tb0508:
Using an 18v15 with DIR and PWM pin I use.

What is an 18v15? Link?

tb0508:
The output of the code display great with the error, turnpos, currentpos. Just the wiper motor, once it starts, it just continues looping instead of only going 30-40 degrees to the left or right from the upright vertical position.

What kind of motor? Do you mean wiper like from an automobile? A servo?

What code is specific to controlling it?

It would probably be helpful if you simplified your code to just controlling this wiper motor. Trying to follow your logic is a bit difficult.

Just the wiper motor, once it starts, it just continues looping instead of only going 30-40 degrees to the left or right from the upright vertical position.

Ever notice that when you turn off a car windshield wiper via its switch that it continues to move until it gets to its parked position? The only time when it stops mid stroke is when you turn off the ignition, killing all power to it.

Did I hear a "swoooosh"? So what is the arduino "stop" function actually connected to?

Sorry, I do not understand your sarcastic remark. "Stop function" connected too? Do you understand what I am trying to do?

I totally understand what you are trying to do, but your failure to answer my question indicates to me you may not have the required operating knowledge of the wiper motor you are working with. :roll_eyes:

tb0508:
Using an 18v15 with DIR and PWM pin I use. I have tried to implement it but it seems that once I turn the wheel the wiper motor just loops around until it stops or blows the 10A fuse we have. So, something is obviously wrong with my code.

I also had the problem of once I flipped the power switch the wiper motor would start turning without doing anything so I implemented the analogWrite(0) in the setup to turn it off. The part of code in question start with /STEERING*

The output of the code display great with the error, turnpos, currentpos. Just the wiper motor, once it starts, it just continues looping instead of only going 30-40 degrees to the left or right from the upright vertical position. The wiper motor shaft is upright, and I want it to turn either left about 30 degrees or right 30 degrees. And if it is all the way left 30 degrees and then go back right. It now acts like it has no max or min and just continuously turns.

I have no idea what you mean by any of that. Could you explain the problem again, but this time assume that I don't know anything at all about your setup?

What is the 'wiper motor'? What is it connected to mechanically? How is it connected up electrically? What are you trying to do with it?