Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Editing Main.c (http://www.chiefdelphi.com/forums/showthread.php?t=24590)

Astronouth7303 07-02-2004 21:40

Re: Editing Main.c
 
Check that the file isn't read-only, and doesn't have other protection. If that doesn't work, there's always notepad.


PS to other Main.c readers: In the Programming code Fix FRC thread, a recent post brings up something about PWMs 13, 14, 15, and 16. READ IT!

Mark McLeod 08-02-2004 10:51

Re: Editing Main.c
 
Quote:

Originally Posted by mtrawls
Hrm... editing main.c, sounds like a good idea. Only I can't. MPLAB won't let me change it -- it isn't accepting any input at all when I have that file in focus. Is there some sort of default protection to protect the unawares that I am unaware about? It was somewhat distressing when, during testing, I did actually want to put something there. Just another reason why MPLAB was getting me angry ... it has several, well "interesting" qualities.

In MPLAB with any file open go to EDIT -> Properties...
and unclick the "Protect Read Only files" box.

Raven_Writer 08-02-2004 11:28

Re: Editing Main.c
 
Why did IF protect almost all the source files anyways?

SeanCassidy 08-02-2004 18:00

Re: Editing Main.c
 
Quote:

Originally Posted by Raven_Writer
Why did IF protect almost all the source files anyways?

So your overzealous aspiring programming teammates don't destroy the source code I guess. ;)

Astronouth7303 08-02-2004 20:23

Re: Editing Main.c
 
Quote:

Originally Posted by SeanCassidy
So your overzealous aspiring programming teammates don't destroy the source code I guess. ;)

Oh, You have other programmers on your team? You got it good!

Joe Ross 08-02-2004 22:19

Re: Editing Main.c
 
Quote:

Originally Posted by SeanCassidy
So your overzealous aspiring programming teammates don't destroy the source code I guess. ;)

No, its to protect you from yourself.

Astronouth7303 09-02-2004 07:25

Re: Editing Main.c
 
Too bad, that's what this is about! :) Don't you feel safer now?

Astronouth7303 20-02-2004 16:45

Pause Function
 
copied from my other post.

Code:

#define PAUSE_SWITCH p4_trig //Change as necessary

//...
  while (1)  /* This loop will repeat indefinitely. */
  {
#ifdef _SIMULATOR
    statusflag.NEW_SPI_DATA = 1;
#endif
if (!PAUSE_SWITCH)
{
    if (statusflag.NEW_SPI_DATA)      /* 26.2ms loop area */
    {                                /* I'm slow!  I only execute every 26.2ms because */
                                      /* that's how fast the Master uP gives me data. */
      Process_Data_From_Master_uP();  /* You edit this in user_routines.c */

      if (autonomous_mode)            /* DO NOT CHANGE! */
      {
        User_Autonomous_Code();        /* You edit this in user_routines_fast.c */
      }
    }
    Process_Data_From_Local_IO();    /* You edit this in user_routines_fast.c */
                                      /* I'm fast!  I execute during every loop.*/
}
  } /* while (1) */
//...

Basically, if you flip the switch, the robot will finish, and then go into a really fast loop: it does nothing until you turn it off. Be sure to put something similar in the auto.mode code: it has its own loop.


All times are GMT -5. The time now is 00:01.

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