Go to Post CAD pictures are cool, but hardware in hand is cooler. :) - ajlapp [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

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-01-2007, 23:04
354.FIRST 354.FIRST is offline
Registered User
FRC #0354
 
Join Date: Jan 2006
Location: Brooklyn, NY
Posts: 26
354.FIRST is an unknown quantity at this point
From MPLAB To EASY C PRO

All,

We have been using MPLAB and have made the move to EASY C.
I am personally much more comfortable in MPLAB, but using EASY C will allow us to include more people in the coding process.

Here's my question: Can someone explain how loops work in Easy C? In MPLAB it seems pretty obvious to me between the get data and put data... I would never put an infinite loop. In EasyC there are all sorts of infinite loops. I don't understand this...

For example in the kickoff demo code... in SeekLight it says while(!done). But I cannot find any change to done... Similarly the While(1) in autonomous as well as the While(1) stump where the writer suggests you "put tube delivery code here"

HELP!

I'm trying to make the camera seek the light when it does not see any light and I am stuck understanding these loops.

Thank you all very much.

-354 programmer
  #2   Spotlight this post!  
Unread 30-01-2007, 16:31
dcbrown dcbrown is offline
Registered User
AKA: Bud
no team
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Hollis,NH
Posts: 236
dcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud ofdcbrown has much to be proud of
Re: From MPLAB To EASY C PRO

Lots of stuff done in the background for you in EasyC.

The getdata/putdata are down in the background. You can still check to see if or when new data arrives.

The autonomous() routine is automatically ended in EasyC when the robot comes out of autonomous mode.
  #3   Spotlight this post!  
Unread 30-01-2007, 16:40
354.FIRST 354.FIRST is offline
Registered User
FRC #0354
 
Join Date: Jan 2006
Location: Brooklyn, NY
Posts: 26
354.FIRST is an unknown quantity at this point
Re: From MPLAB To EASY C PRO

How does it work with the infinite loops in Easy C?
When should I use an infinite loop?
Can't I assume that any code I write will be read once every process cycle like in MPLAB? Why do we need infinite loops in Easy C?
Thanks
-354
  #4   Spotlight this post!  
Unread 30-01-2007, 17:13
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: From MPLAB To EASY C PRO

In operator control you should do a infinte loop and thats it. The rest of the time any loops are optional. If you break out of the infinite loop in operator control the robot will just stop moving.

People like using timers in autonomous mode or ending the auto program once the sequnce has been completed. This is what Neil did in the code your are talking about. If you set done = 1 then code would end. Because ! = not so
while( !done) means while ( (not)done).
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #5   Spotlight this post!  
Unread 30-01-2007, 16:39
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: From MPLAB To EASY C PRO

easyC there is no fast and slow loop. The code just loops as fast as it can in the user processor. If you don't loop the code it will just stop. For every loop easyC checks the status of the inputs. You should check out the help file tutorials real quick and you should get a handle on it especially with previous C experience.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
Closed Thread


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
Problem with easy c pro and mechanum wheels pbrules15 Programming 9 03-02-2007 20:38
moving a model from pro desktop to 3dsmax 8 Amittt Inventor 0 19-01-2006 10:02
MPLab to Easy C sbwprotoss9 Programming 1 12-01-2006 22:00
Easy C, Missing from KOP? MarkVH Programming 14 09-01-2006 17:48
Easy $25 from teammates Mullen Chit-Chat 9 04-05-2002 23:57


All times are GMT -5. The time now is 18:26.

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