PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → Celular Acelerometro Detect Landscape or Portrait - Detecta se o celular esta em Retrato ou paisagem
Celular Acelerometro Detect Landscape or Portrait - Detecta se o celular esta em Retrato ou paisagem
Débuté par adrianoboller, 24 nov. 2014 12:17 - Aucune réponse
Membre enregistré
3 657 messages
Popularité : +175 (223 votes)
Posté le 24 novembre 2014 - 12:17
// Summary: Detects the acceleration
// Syntax:
//SYS_Acelerometro_Detect (<nVertical>, <nLongitudinal>, <nLateral>)
//
// Parameters:
//nVertical: correspond to the measurement of the device acceleration on the vertical axis (Z) in m/s²
//nLongitudinal: correspond to the measurement of the device acceleration on the longitudinal axis (Y) in m/s²
//nLateral: correspond to the measurement of the device acceleration on the horizontal axis (X) in m/s²
// Example:
// Indicate an example.
//
//Speed (integer): <specify the role of Speed>
// Return value:
Procedure SYS_Acelerometro_Detect(nVertical, nLongitudinal, nLateral)

// Display the speeds
sVertical is string = IntegerPart(nVertical) + “.” + DecimalPart(nVertical)[[3 TO 4]]
sLongitudinal is string = IntegerPart(nLongitudinal) + “.” + DecimalPart(nLongitudinal)[[3 TO 4]]
sLateral is string = IntegerPart(nLateral) + “.” + DecimalPart(nLateral)[[3 TO 4]]

// Retrieve the lateral speed
nMaxLateralSpeed is int = IntegerPart(nLateral)
IF nMaxLateralSpeed < 0 THEN
nMaxLateralSpeed = -nMaxLateralSpeed
END

IF sLateral >= 7 THEN
gsHorizontalVertical = "Horizontal"
ELSE
gsHorizontalVertical = "Vertical"
END