|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
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.
|
|
#4
|
|||
|
|||
|
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 |
|
#5
|
||||
|
||||
|
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). |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |