|
Hello!
I just started using brickOS and am trying to use it as a programmable function
generator. As such, I'm trying to get good repeatability on cycle time.
It appears that at 'random' times, the RCX scheduler(?) is interrupting my
program to do task maintenance. I would like the scheduler to run during the
time when my output is high, but finish before my output must go low again, so
as not to maintain repeatability.
How can I achieve this behavior? Does it involve setting priorities on tasks?
If so, how do I set the priority of the 'main' task or the scheduler?
My simple program is below for your reference. Please get back to me at your
earliest convenience, as I have to have this ready by tomorrow noon. Thank
you!
Sincerely,
Neville Bonwit
----------------------------------------
#include <config.h>
#include <conio.h>
#include <unistd.h>
#include <tm.h>
#include <c++/Motor.H>
int
main(int argc,
char **argv)
{
Motor mA(Motor::A);
Motor mB(Motor::B);
mA.speed(mA.max);
mB.speed(mB.max);
while(true)
{
mA.forward();
msleep(1);
mA.brake();
msleep(1);
mB.forward();
msleep(1);
mB.brake();
msleep(1);
}
cls();
return 0;
}
|
|
1 Message in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|