|
|
|
![]() |
|
|||||||
|
||||||||
|
|
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 | 22-01-2007 23:23 |
| problems using gyro/adc code with camera default code | tanstaafl | Programming | 7 | 22-01-2006 23:09 |
| Question about Solenoid and default code | waialua359 | Control System | 4 | 21-01-2006 18:21 |
| navigate and default code newbie question | alan koch | Programming | 2 | 17-02-2004 22:25 |
| Rookie Programmer has question about the default code | DanL | Programming | 3 | 26-01-2002 19:59 |