Go to Post This is the best experience you will ever get. - Arefin Bari [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 04-24-2007, 01:24 AM
Andy L's Avatar
Andy L Andy L is offline
Registered User
FRC #1458
Team Role: Alumni
 
Join Date: Mar 2007
Rookie Year: 2006
Location: Danville
Posts: 348
Andy L has much to be proud ofAndy L has much to be proud ofAndy L has much to be proud ofAndy L has much to be proud ofAndy L has much to be proud ofAndy L has much to be proud ofAndy L has much to be proud ofAndy L has much to be proud ofAndy L has much to be proud of
Send a message via AIM to Andy L
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);
}
I honestly have no clue on how that does a one joystick drive
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 04:03 PM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi