SunSPOT API V3.0


com.sun.spot.sensorboard.peripheral
Interface IToneGenerator

All Known Implementing Classes:
ToneGenerator

public interface IToneGenerator

Interface to represent a simple tone generator. Should have something like a real frequency response, to participate in this interface.

Author:
arshan

Method Summary
 void beep()
          Initiate a tone at the set frequency for the set duration, the beep will terminate itself asynchronously.
 void endTone()
          end running tone
 double getFrequency()
          get the current frequency setting
 void setDuration(int dur)
          Set the duration of current beep time.
 void setFrequency(double hz)
          set the desired tone frequency
 void startTone()
          start a tone at the set frequency
 

Method Detail

setFrequency

void setFrequency(double hz)
set the desired tone frequency

Parameters:
hz - value of frequency in Hertz

getFrequency

double getFrequency()
get the current frequency setting

Returns:
frequency value in Hertz

setDuration

void setDuration(int dur)
Set the duration of current beep time.

Parameters:
dur - the time of the duration in milliseconds

beep

void beep()
Initiate a tone at the set frequency for the set duration, the beep will terminate itself asynchronously.


startTone

void startTone()
start a tone at the set frequency


endTone

void endTone()
end running tone


SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.