To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.nqcOpen lugnet.robotics.rcx.nqc in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / NQC / 714
713  |  715
Subject: 
Re: Scout programming in RcxCC
Newsgroups: 
lugnet.robotics.rcx.nqc, lugnet.robotics.scout, lugnet.robotics.rcx
Date: 
Fri, 18 Aug 2000 04:29:24 GMT
Viewed: 
3608 times
  
In article <399BC928.FE3AB9BA@yahoo.com>, Zhengrong Zang
<legozang@yahoo.com> wrote:

task check_touch()
// Checks whether touch sensors are touched and takes action
{
    while (true) {
        if (SENSOR_1 == 1) {
    stop check_light;
           if (touchnumb > 1) {
               // Stop everything else
               StopMotor
               PlaySound(SOUND_UP);
               Wait(9);
               stop check_touch;
           }
           else {
               // backup a bit and try from there
               touchnumb += 1;
               Backward(7, 100);
               Forward(7, 0);
        start check_light;
           }
        }
    }
}



Zhengrong - I tried replying to your e-mail, but it bounced.   I'll
reply here (since the answer may be of interest to others as well).

The issue was that the above code needed a Wait(9) in order for the
sound to be heard on the Scout, but the RCX didn't require a Wait.

I think the problem is that after playing the sound you stop the task
that requested the sound to be played.  Sounds get queued up and
played asynchronously...this means that the sound will have just
started (perhaps only a millisecond of sound played) when the 'stop'
command is executed.  I'm guessing that on the Scout the sound got
canceled out of the queue when the task ended, while in the RCX it did
not.  I'm not sure why Wait(9) would fix this...that's not enough time
for the sound to finish.  Perhaps though its enough time for the sound
to start playing (and thus be "committed").

When I get some time, I'll try verifying this more completely (including
RCX 2.0 firmware), but I doubt there will be a fix other than what you
did.

Dave

--
reply to: dbaum at enteract dot com



Message is in Reply To:
  Scout programming in RcxCC
 
After follow Dave's suggestion, I am successful to use RcxCC for Scout programming, here is the method. Edit two batch files named rcx.bat and scout.bat in rcxcc directory, the content of files are as follows: set NQC_OPTIONS=-TRCX rcxcc set (...) (24 years ago, 17-Aug-00, to lugnet.robotics.rcx.nqc, lugnet.robotics.scout, lugnet.robotics.rcx)

4 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR