|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Default code question
I was going through the default code today and I had passed this particular segment and wondered exactly how it works. to let you all know I am a new programmer and our current programmer is a senior and doesn't explain anything to me.
Code:
p1_x = 255 - p1_y; p1_y = 255 - pwm05; pwm13 = pwm14 = Limit_Mix(2000 + p1_y + p1_x - 127); pwm15 = pwm16 = Limit_Mix(2000 + p1_y - p1_x + 127); Code:
unsigned char Limit_Mix (int intermediate_value)
{
static int limited_value;
if (intermediate_value < 2000)
{
limited_value = 2000;
}
else if (intermediate_value > 2254)
{
limited_value = 2254;
}
else
{
limited_value = intermediate_value;
}
return (unsigned char) (limited_value - 2000);
}
|
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 2007 IFI default code question | Japper | Programming | 4 | 01-22-2007 11:23 PM |
| problems using gyro/adc code with camera default code | tanstaafl | Programming | 7 | 01-22-2006 11:09 PM |
| Question about Solenoid and default code | waialua359 | Control System | 4 | 01-21-2006 06:21 PM |
| navigate and default code newbie question | alan koch | Programming | 2 | 02-17-2004 10:25 PM |
| Rookie Programmer has question about the default code | DanL | Programming | 3 | 01-26-2002 07:59 PM |