![]() |
PWM Speed
This is our first year and we are having some problems with the programming. We need to set a lower maximum value for the PWM02 motor. Something like 200. We are using the default code. How would this be achieved?
|
Re: PWM Speed
You would probably want to scale the precision of whatever control mechanism or joystick you are using to get the full scale of motion, so this should graph that to the new maximum:
Code:
long answer; //Must be long to hold precise values |
Re: PWM Speed
Quote:
Code:
#define MAX_VALUE 200 //Replace 200 with whatever you want your max value to beThen, the actual solution: Code:
if(p1_x > 127) //Replace p1_x with whatever joystick and axis you want |
| All times are GMT -5. The time now is 01:00. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi