|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#2
|
|||||
|
|||||
|
Re: Programing delays in MPLAB
There is no single function through MPLAB, but there are several ways to accomplish what you want. The simplest is to just use a count of the slow radio packet loops as an approximation of time.
Here's an example. Code:
#define HOW_LONG 38 //38 = 1 second, e.g., 76 = 2 seconds
static int counter=0;
if (counter < HOW_LONG)
{
counter++;
// Drive at half speed
pwm01 = 127 - 60;
pwm02 = 127 + 60;
}
else
{
// Stop driving
pwm01 = 127;
pwm02 = 127;
}
There's a white paper on understanding timers here: http://www.ifirobotics.com/docs/time...004-jan-14.pdf Last edited by Mark McLeod : 14-02-2008 at 12:25. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| WEATHER DELAYS!! | Gamer930 | General Forum | 3 | 16-03-2007 21:44 |
| "VENDORs", reasonable delays in shipping due to out of stock items, and other errata | Madison | General Forum | 12 | 08-12-2006 18:14 |
| [UFH]: October Unsung FIRST Heroes Delays | Amanda Morrison | Unsung FIRST Heroes | 1 | 03-10-2005 00:51 |
| using the MPLAB IDE MPLAB SIM simulator | WizardOfAz | Programming | 1 | 03-11-2003 01:24 |
| weather delays? | archiver | 2001 | 6 | 23-06-2002 22:11 |