pmVibration (Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

MX2, CX1, SX1, MX2 turbo/encore/warp, NX-200, NX-900, LX2, LX5

Firmware version:

1.00 / 1.40.00


Query whether vibration has been detected by the on-board vibration sensor.

The pmVibration() function will return whether vibration has been detected since the last call. It is the responsibility of application to call pmVibration() frequently so that the information processed is upto date.

The sensivity of the vibration sensor can be adjusted by calling the function pmSetVibrationSensivity().

 

 

Input:                

None.

 

Returns: BOOL

TRUE:

- Vibration has been detected since last call.

FALSE:

- No vibration has been detected since last call.

 

Declaration:

FUNCTION pmVibration : BOOL;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
pmSetVibrationSensivity(sen:=25);
 
DebugMsg(message:="Running...");
BEGIN
  IF NOT pmVibration() THEN
     DebugMsg(message:="No movement.. Sleep");
     pmWaitEvent(Vibration:=TRUE);
     DebugMsg(message:="Wakeup");
  END_IF;
END;
 
END_PROGRAM;