Go to Post I think that this clearly indicates that 2017 will be the year we finally see 3.63 robots per alliance. - Caleb Sykes [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
  #3   Spotlight this post!  
Unread 14-01-2007, 23:39
BradAMiller BradAMiller is offline
Registered User
AKA: Brad
#0190 ( Gompei and the Herd)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Worcester, MA
Posts: 592
BradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant futureBradAMiller has a brilliant future
Re: EasyC OI Inputs?

Quote:
Originally Posted by Greg Marra View Post
Why does the "drive" library use a different metaphor than the rest of the program? I find this rather confusing. [/edit]
It would have been nice if everything worked using the -127 - +127 metaphor since it makes much more sense than having an arbitrary value of 127 for stopped. The reason the rest of the code doesn't do that is because of easyC compatibility. It had the SetPWM functions that did the 0-255 thing.

But the drive library make some things incredibly easy to do, especially around control problems. For example, you can use a gyro to drive in a straight line with this fairly simple program:

Code:
void main(void)
{
    int heading;
    InitGyro(1);             // initialize gyro on port 1
    TwoWheelDrive(2,1);      // Setup 2 motor drive robot (ports 1 & 2)
    StartGyro(1);             // start gyro sampling
    while (1)
    {
        heading = GetGyroAngle(1); // get the current heading
        Drive(80, heading/2); // turn towards the error
    }
}
And that's the whole program, no other files required.

So we use the drive stuff, but it isn't necessary. It helps with the bookkeeping of remember which way all the motors need to go and basically decouples the driving and turning values so you can think of them independently.
__________________
Brad Miller
Robotics Resource Center
Worcester Polytechnic Institute
 


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
VEX inputs Andrew Blair FIRST Tech Challenge 22 31-05-2006 18:17
Analog Inputs bush Programming 5 13-03-2006 17:49
Kickoff easyC workshop integrated into EasyC help file Dan Larochelle Programming 0 11-01-2006 06:12
PWM inputs? ghansel Control System 7 14-09-2005 17:57
Joystick Inputs Jatheon4316 Programming 12 06-02-2005 17:25


All times are GMT -5. The time now is 20:53.

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