SunSPOT API V6.0


com.sun.spot.resources.transducers
Interface IToneGenerator

All Superinterfaces:
IResource, ITransducer
All Known Subinterfaces:
IToneGenerator
All Known Implementing Classes:
ToneGenerator

public interface IToneGenerator
extends ITransducer

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

Author:
arshan, ron (modified for Yellow, July 2010)

Method Summary
 void beep()
          Deprecated. Please use startTone(double hz, int dur) instead
 void endTone()
          Deprecated. Please use stopTone() instead
 double getFrequency()
          Deprecated.  
 void setDuration(int dur)
          Deprecated. Please use startTone(double hz, int dur) instead
 void setFrequency(double hz)
          Deprecated. please specify the desired frequency in the call to startTone()
 void startTone()
          Deprecated. Please use startTone(double hz) instead
 void startTone(double hz)
          start a tone at the specified frequency
 void startTone(double hz, int dur)
          start a tone at the specified frequency for the specified duration
 void stopTone()
          stop current tone
 
Methods inherited from interface com.sun.spot.resources.transducers.ITransducer
createSensorEvent, getDescription, getMaxSamplingRate, saveEventState
 
Methods inherited from interface com.sun.spot.resources.IResource
addTag, getTags, getTagValue, hasTag, removeTag
 

Method Detail

startTone

void startTone(double hz)
start a tone at the specified frequency

Parameters:
hz - value of frequency in Hertz

startTone

void startTone(double hz,
               int dur)
start a tone at the specified frequency for the specified duration

Parameters:
hz - value of frequency in Hertz
dur - the time of the duration in milliseconds

stopTone

void stopTone()
stop current tone


setFrequency

void setFrequency(double hz)
Deprecated. please specify the desired frequency in the call to startTone()

set the desired tone frequency

Parameters:
hz - value of frequency in Hertz

getFrequency

double getFrequency()
Deprecated. 

get the current frequency setting

Returns:
frequency value in Hertz

setDuration

void setDuration(int dur)
Deprecated. Please use startTone(double hz, int dur) instead

Set the duration of current beep time.

Parameters:
dur - the time of the duration in milliseconds

beep

void beep()
Deprecated. Please use startTone(double hz, int dur) instead

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


startTone

void startTone()
Deprecated. Please use startTone(double hz) instead

start a tone at the set frequency


endTone

void endTone()
Deprecated. Please use stopTone() instead

end running tone


SunSPOT API V6.0


Copyright © 2006-2010 Oracle. All Rights Reserved.