PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
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
Started by adrianoboller, Nov., 24 2014 12:17 PM - No answer
Connect yourself…
adrianoboller
#1
Registered member
3,659 messages
Popularité : +175 (223 votes)
Posted on November, 24 2014 - 12:17 PM
// 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
(
n
Vertical
,
n
Longitudinal
,
n
Lateral
)
// Display the speeds
s
Vertical is
string
=
IntegerPart
(
n
Vertical
) + “
.
” +
DecimalPart
(
n
Vertical
)
[
[
3
TO
4
]
]
s
Longitudinal is
string
=
IntegerPart
(
n
Longitudinal
) + “
.
” +
DecimalPart
(
n
Longitudinal
)
[
[
3
TO
4
]
]
s
Lateral is
string
=
IntegerPart
(
n
Lateral
) + “
.
” +
DecimalPart
(
n
Lateral
)
[
[
3
TO
4
]
]
// Retrieve the lateral speed
n
MaxLateralSpeed is
int
=
IntegerPart
(
n
Lateral
)
IF
n
MaxLateralSpeed
<
0
THEN
n
MaxLateralSpeed
= -
n
MaxLateralSpeed
END
IF
s
Lateral
>
=
7
THEN
gs
HorizontalVertical
=
"Horizontal"
ELSE
gs
HorizontalVertical
=
"Vertical"
END
Report
0
0
→ Go back to WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text