Subject:
|
Re: How to user MONITOR command for watching TIMER in Spybotics
|
Newsgroups:
|
lugnet.robotics.rcx.nqc
|
Date:
|
Sun, 13 Jul 2003 05:25:43 GMT
|
Viewed:
|
5366 times
|
| |
| |
Dear Dave,
Thank you for your reply.
In fact, for several nights I was using very similar snippet you provided to
watch the timer before posting my problem, however, I was careless to spell the
Timer(0) with TIMER(0) and the compiler always complained parse error !
Now I solved my problem. Again, many thanks !
Best Regards,
Liem PH
In lugnet.robotics.rcx.nqc, Dave Baum wrote:
> This program below shows how a timer event can be used.
>
> Dave Baum
>
> ----
>
> #define MY_EVENT 0
>
> task main()
> {
> ClearTimer(0);
> SetEvent(MY_EVENT, Timer(0), EVENT_TYPE_HIGH);
> SetUpperLimit(MY_EVENT, 1000);
>
> monitor(EVENT_MASK(MY_EVENT)) {
> while(true) {
> Wait(100);
> PlaySound(SOUND_CLICK);
> }
> }
>
> PlaySound(SOUND_UP);
> }
>
>
>
> In article <HHswKM.pE4@lugnet.com>,
> "Liem Peng Hong" <liemph@nais.ne.jp> wrote:
>
> > Dear Members,
> >
> > I managed to use NQC MONITOR command to watch TIMERs in my SCOUT using the
> > predefined SCOUT events (EVENT_TIMER_0). However, I failed with my Spybotics
> > and
> > RCX 2.0.
> >
> > My question is how can I use the MONITOR command to watch TIMERs (or maybe
> > COUNTERs) in my Spybotics and RCX. Concretely I'd like to do the following
> > thing:
> >
> > 1. Clear TIMER(0).
> > 2. Set TIMER(0) limit to 1000
> > 2. SetEvent 0 to TIMER(0) over limit
> > 3. Monitor MASK_EVENT(0) whether TIMER(0) over limit the preset value (1000).
> >
> > Thank you in advance.
> >
> > Liem PH.
|
|
Message is in Reply To:
3 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|