-
Notifications
You must be signed in to change notification settings - Fork 0
/
Accelerometer.cljs
97 lines (67 loc) · 3 KB
/
Accelerometer.cljs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
(ns web.accelerometer.Accelerometer
"The Accelerometer interface of the Sensor APIs provides on each
the acceleration applied to the device along all three axes."
(:refer-clojure :exclude []))
(def constructor
"Constructor.
The Accelerometer constructor creates a new `web.accelerometer.Accelerometer` object which returns the acceleration of the device along all three axes at the time it is read.
options Optional
Options are as follows:
frequency: The desired number of times per second a sample should be taken, meaning the number of times per second that `sensor.onerror` will be called. A whole number or decimal may be used, the latter for frequencies less than a second. The actual reading frequency depends device hardware and consequently may be less than requested.
referenceFrame: Either 'device' or 'screen'. The default is 'device'.
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Accelerometer/Accelerometer`"
js/Accelerometer)
(defn x
"Property.
The x read-only property of the `web.accelerometer.Accelerometer`
returns a double precision integer containing the acceleration
the device along the its x axis.
`var xAcceleration = accelerometer.x`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Accelerometer/x`"
[this]
(-> this (.-x)))
(defn set-x!
"Property.
The x read-only property of the `web.accelerometer.Accelerometer`
returns a double precision integer containing the acceleration
the device along the its x axis.
`var xAcceleration = accelerometer.x`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Accelerometer/x`"
[this val]
(aset this "x" val))
(defn y
"Property.
The y read-only property of the `web.accelerometer.Accelerometer`
returns a double precision integer containing the acceleration
the device along the its y axis.
`var yAcceleration = accelerometer.y`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Accelerometer/y`"
[this]
(-> this (.-y)))
(defn set-y!
"Property.
The y read-only property of the `web.accelerometer.Accelerometer`
returns a double precision integer containing the acceleration
the device along the its y axis.
`var yAcceleration = accelerometer.y`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Accelerometer/y`"
[this val]
(aset this "y" val))
(defn z
"Property.
The z read-only property of the `web.accelerometer.Accelerometer`
returns a double precision integer containing the acceleration
the device along the its z axis.
`var zAcceleration = accelerometer.z`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Accelerometer/z`"
[this]
(-> this (.-z)))
(defn set-z!
"Property.
The z read-only property of the `web.accelerometer.Accelerometer`
returns a double precision integer containing the acceleration
the device along the its z axis.
`var zAcceleration = accelerometer.z`
See also: `https://developer.mozilla.org/en-US/docs/Web/API/Accelerometer/z`"
[this val]
(aset this "z" val))