webduino.module.ADXL345
The ADXL345 class.
ADXL345 is a small, thin, ultralow power, 3-axis accelerometer.
Table of Contents
- Methods
- Attributes
Constructor
webduino.module.ADXL345
-
board
Parameters:
-
board
webduino.BoardThe board that the ADXL345 accelerometer is attached to.
Methods
addListener
-
type
-
listener
Add a listener for a certain type of event.
Parameters:
-
type
StringEvent type.
-
listener
FunctionEvent listener.
detect
-
callback
Start detection.
Parameters:
-
[callback]
Function optionalDetection callback.
emit
-
type
-
object,...
Emit an event of certain type.
Parameters:
-
type
StringEvent type.
-
[object,...]
Object optionalEvent object(s).
listeners
-
type
Return the listener list bound to certain type of event.
Parameters:
-
type
StringEvnet type.
off
()
Stop detection.
on
-
callback
Start detection.
Parameters:
-
[callback]
Function optionalDetection callback.
once
-
type
-
listener
Add a one-time listener for a certain type of event.
Parameters:
-
type
StringEvent type.
-
listener
FunctionEvent listener.
refresh
()
Reset detection value.
removeAllListeners
-
type
Remove all listeners of certain type.
Parameters:
-
type
StringEvent type.
removeListener
-
type
-
listener
Remove a listener for certain type of event.
Parameters:
-
type
StringEvent type.
-
listener
FunctionEvent listener.
setBaseAxis
-
axis
Set the base axis for calculation.
Parameters:
-
axis
StringAxis to be set to, either
x
,y
, orz
.
setDetectTime
-
detectTime
Set detecting time period.
Parameters:
-
detectTime
NumberThe time period for detecting, in ms.
setMaxListeners
-
n
Set maximum number of listeners that is allow to bind on an emitter.
Parameters:
-
n
NumberNumber of listeners.
setSensitivity
-
sensitivity
Set detection sensitivity.
Parameters:
-
sensitivity
NumberDetection sensitivity.
Attributes
Events
ADXL234Event.MESSAGE
Fires when the accelerometer senses a value change.