Hi Derek,
No worries about the name, I get called Dan all the time since my o's tend to look like a's to most people.
I took another look at Motor.cpp and noticed a few things:
You are realy only using the pwm out of the object and trying to override the direction bits, which get set back when you set speed.
Motor expects to set a forward or a reverse bit for direction, both on for break, of both off for coast. The controls for your driver are realy direction and break.
The pwm output gets set to the absolute value of the value passed, so always 0.0 to 1.0, and the sign is used to set the forward and reverse bits.
I suggest you use simple PwmOut()'s for the speeds and the direction bits you already have defined.
Change the range for speed to 0.0 to 1.0 for both directions.
If that works, you might want to restructure the code a bit to have a single RampUp and RampDown function since the forward and reverse routines will be almost identical. Set the direction bits, call ramp up, wait, call ramp down, change direction and repeat.
Cheers,
Don
Hi everyone, I'm trying to run two motors up to full speed in one direction then reverse them using an old Magnevation board I have. The problem I have is at full speed in one direction the output for speed direction changes hence not a nice result! The pwm voltage output ramps up nicely from 0v to +3.2v then ramps down again to 0v. Where am I going wrong in the code please??