Subject:
|
Re: nop in NQC?
|
Newsgroups:
|
lugnet.robotics
|
Date:
|
Mon, 5 Jan 2004 18:59:40 GMT
|
Viewed:
|
1174 times
|
| |
 | |
In lugnet.robotics, Brian Davis wrote:
> Is there a NQC command that will translate to a simple nop bytecode? I'm
> looking for a way to do fine-precision timing, and frankly checking a timer
> takes too long. For very fine motor control, I'm trying to use sequences like:
>
> On(OUT_A+OUT_C);
> Off(OUT_A+OUT_C);
you may try something like this:
On(OUT_A+OUT_C);
On(OUT_A+OUT_C);
Off(OUT_A+OUT_C);
or if you're looking for speed control, you could try:
if (speed>5) On(OUT_A+OUT_C);
else Off(OUT_A+OUT_C);
if (speed>4) On(OUT_A+OUT_C);
else Off(OUT_A+OUT_C);
if (speed>3) On(OUT_A+OUT_C);
else Off(OUT_A+OUT_C);
if (speed>2) On(OUT_A+OUT_C);
else Off(OUT_A+OUT_C);
if (speed>1) On(OUT_A+OUT_C);
else Off(OUT_A+OUT_C);
so, you could set the speed to a number between 0 and 6. 0 being all off, 6
being all on
I really don't know enough about NQC to say if that will do just what you want,
but it could be good to try.
And, if you want to run the motors at different speeds, intermix the speed
settings for each side:
if (speedA>5) On(OUT_A);
else Off(OUT_A);
if (speedC>5) On(OUT_C);
else Off(OUT_C);
if (speedA>4) On(OUT_A);
else Off(OUT_A);
if (speedC>4) On(OUT_C);
else Off(OUT_C);
if (speedA>3) On(OUT_A);
else Off(OUT_A);
if (speedC>3) On(OUT_C);
else Off(OUT_C);
if (speedA>2) On(OUT_A);
else Off(OUT_A);
if (speedC>2) On(OUT_C);
else Off(OUT_C);
if (speedA>1) On(OUT_A);
else Off(OUT_A);
if (speedC>1) On(OUT_C);
else Off(OUT_C);
|
|
Message is in Reply To:
 | | nop in NQC?
|
| Is there a NQC command that will translate to a simple nop bytecode? I'm looking for a way to do fine-precision timing, and frankly checking a timer takes too long. For very fine motor control, I'm trying to use sequences like: On(OUT_A+OUT_C); (...) (21 years ago, 5-Jan-04, to lugnet.robotics)
|
8 Messages in This Thread:   
  
  
  
  
    
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|