To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 6759
6758  |  6760
Subject: 
RE: Sound
Newsgroups: 
lugnet.robotics
Date: 
Tue, 7 Sep 1999 21:38:30 GMT
Original-From: 
Stalker-Wilde, Graham <[graham.stalker-wilde@csfb]saynotospam[.com]>
Viewed: 
790 times
  
If all you want to know is the output then the RCX will display that - using
the View button to show the sensor input you're interested in. If you want
to play pretty noises the only alternative I can think of (and this is ugly)
is along the lines of

if (IN_1 == 1)
{
PlaySound(1);
}
else if  (IN_1 == 2)
{
PlaySound(2);
}

etc.

Obviously you wouldn't want to do this for every value from 0 to 1000, or
whatever, but you might do it in bands 0-100, 100-200, etc. and you could
write this in a subroutine.

Equally obviously, you'd rather have a switch statement, but NQC doesn't.
(NQC still gets my vote, though.)

-g





-----Original Message-----
From: Ben Erwin [SMTP:berwin@tufts.edu]
Sent: Tuesday, September 07, 1999 1:41 AM
To: lego-robotics@crynwr.com
Subject: Re: Sound

The answer I got was "its a firmware thing" -- not that its much of
a
helpful answer (to me or to you).  A while ago I was really hoping
to be
able to do the same thing... especially since setting the motor
speed to be
dependent on the light sensor doesn't produce an easily visible
feedback
since the new motors don't seem to change speed much.  I ended up
using a
lego lamp for the experiment instead.

-Ben

Martin Thompson wrote:

> I wanted to make the RCX make a certain pitched sound based on
sensor
> readings the other day (primarily the light sensor), however it
appears
> you can't make the frequency of the command equal to a variable.
Does
> anyone know why this is and if there is any way around this
problem?
>
> Thanks,
>   Marty.
>
> --
> Did you check the web site first?:
http://www.crynwr.com/lego-robotics
--
Did you check the web site first?:
http://www.crynwr.com/lego-robotics
--
Did you check the web site first?: http://www.crynwr.com/lego-robotics



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    
Active threads in Robotics

 
Verified and Trusted Team of Hackers
6 hours ago
Custom Search

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