-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconnection.html
267 lines (161 loc) · 10.4 KB
/
connection.html
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
<!DOCTYPE HTML>
<html lang="en-US" manifest="./manifest.appcache">
<head prefix="og: http://ogp.me/ns# book: http://ogp.me/ns/book#">
<meta charset="UTF-8">
<title>connection | Sensorendipity</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="robots" content="index, follow">
<meta name="author" content="">
<meta name="description" content="Sensorendipity is an open source framework that enables you to access the sensor data from your mobile device, easily and in real-time. By formatting and enabling access to the sensor data, live on any web-enabled platform, Sensorendipity now empowers you to discover the amazing world of web-enabled mobile device sensing.">
<meta name="keywords" content="gitbook,github" >
<meta name="generator" content="www.gitbook.io">
<link rel="next" href="./display.html" />
<link rel="prev" href="./coding.html" />
<meta property="og:title" content="connection | Sensorendipity">
<meta property="og:site_name" content="Sensorendipity">
<meta property="og:type" content="book">
<meta property="og:locale" content="en_US">
<meta property="book:author" content="https://github.com/">
<meta property="book:tag" content="GitBook">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
</head>
<body>
<link rel="stylesheet" href="gitbook/style.css">
<div class="book" data-level="3.1" data-basepath="." data-revision="1400555668632">
<div class="book-header">
<!-- Actions Left -->
<a href="https://github.com/null" target="_blank" class="btn pull-left home-bookmark" aria-label="GitHub home"><i class="fa fa-bookmark-o"></i></a>
<a href="#" class="btn pull-left toggle-summary" aria-label="Toggle summary"><i class="fa fa-align-justify"></i></a>
<a href="#" class="btn pull-left toggle-search" aria-label="Toggle search"><i class="fa fa-search"></i></a>
<span id="font-settings-wrapper">
<a href="#" class="btn pull-left toggle-font-settings" aria-label="Toggle font settings"><i class="fa fa-font"></i>
</a>
<div class="dropdown-menu font-settings">
<div class="dropdown-caret">
<span class="caret-outer"></span>
<span class="caret-inner"></span>
</div>
<div class="btn-group btn-block">
<button id="reduce-font-size" class="btn btn-default">A</button>
<button id="enlarge-font-size" class="btn btn-default">A</button>
</div>
<ul class="list-group font-family-list">
<li class="list-group-item" data-font="0">Serif</li>
<li class="list-group-item" data-font="1">Sans</li>
</ul>
<div class="btn-group btn-group-xs btn-block color-theme-list">
<button type="button" class="btn btn-default" id="color-theme-preview-0" data-theme="0">White</button>
<button type="button" class="btn btn-default" id="color-theme-preview-1" data-theme="1">Sepia</button>
<button type="button" class="btn btn-default" id="color-theme-preview-2" data-theme="2">Night</button>
</div>
</div>
</span>
<!-- Actions Right -->
<a href="#" target="_blank" class="btn pull-right google-plus-sharing-link sharing-link" data-sharing="google-plus" aria-label="Share on Google Plus"><i class="fa fa-google-plus"></i></a>
<a href="#" target="_blank" class="btn pull-right facebook-sharing-link sharing-link" data-sharing="facebook" aria-label="Share on Facebook"><i class="fa fa-facebook"></i></a>
<a href="#" target="_blank" class="btn pull-right twitter-sharing-link sharing-link" data-sharing="twitter" aria-label="Share on Twitter"><i class="fa fa-twitter"></i></a>
<!-- Title -->
<h1>
<i class="fa fa-spinner fa-spin"></i>
<a href="./" >Sensorendipity</a>
</h1>
</div>
<div class="book-summary">
<div class="book-search">
<input type="text" placeholder="Search" class="form-control" />
</div>
<ul class="summary">
<li data-level="0" data-path="index.html">
<a href="./"><i class="fa fa-check"></i> Introduction</a>
</li>
<li class="chapter " data-level="1" data-path="settings.html">
<a href="./settings.html">
<i class="fa fa-check"></i> <b>1.</b> Settings
</a>
</li>
<li class="chapter " data-level="2" data-path="data.html">
<a href="./data.html">
<i class="fa fa-check"></i> <b>2.</b> data
</a>
</li>
<li class="chapter " data-level="3" data-path="coding.html">
<a href="./coding.html">
<i class="fa fa-check"></i> <b>3.</b> coding
</a>
<ul class="articles">
<li data-level="3.1" data-path="connection.html">
<a href="./connection.html">
<i class="fa fa-check"></i> <b>3.1.</b> connection
</a>
</li>
<li data-level="3.2" data-path="display.html">
<a href="./display.html">
<i class="fa fa-check"></i> <b>3.2.</b> display
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="4" data-path="faqs.html">
<a href="./faqs.html">
<i class="fa fa-check"></i> <b>4.</b> FAQs
</a>
</li>
<li class="divider"></li>
<li>
<a href="http://www.gitbook.io/" target="blank" class="gitbook-link">Generated using GitBook</a>
</li>
</ul>
</div>
<div class="book-body">
<div class="body-inner">
<div class="page-wrapper" tabindex="-1">
<div class="book-progress">
<div class="bar">
<div class="inner" style="width: 66.66666666666667%;min-width: 50%;"></div>
</div>
<div class="chapters">
<a href="./index.html" title="Introduction" class="chapter done new-chapter" data-progress="0" style="left: 0%;"></a>
<a href="./settings.html" title="Settings" class="chapter done new-chapter" data-progress="1" style="left: 16.666666666666668%;"></a>
<a href="./data.html" title="data" class="chapter done new-chapter" data-progress="2" style="left: 33.333333333333336%;"></a>
<a href="./coding.html" title="coding" class="chapter done new-chapter" data-progress="3" style="left: 50%;"></a>
<a href="./connection.html" title="connection" class="chapter done " data-progress="3.1" style="left: 66.66666666666667%;"></a>
<a href="./display.html" title="display" class="chapter " data-progress="3.2" style="left: 83.33333333333333%;"></a>
<a href="./faqs.html" title="FAQs" class="chapter new-chapter" data-progress="4" style="left: 100%;"></a>
</div>
</div>
<div class="page-inner">
<section class="normal" id="section-gitbook_5">
<h1 id="display-something-if-something-happen">Display something if something happen</h1>
<p>With connection setup and raw data received, the next thing is to let it do something. In this sample[download code], you get to see the code required get an image to display when a value is right.</p>
<p>If you played with GridView-Flot.html, the value of light sensor is 10 when the environment is dark and above 10 when it is lit up. In the example, the code looks for light sensor value and checks if it is less or more than 10 and display the right image with ‘if else’.</p>
<p>Do check out these tutorial to understand what the code is used for:</p>
<p>‘if else’[<a href="http://www.w3schools.com/js/js_if_else.asp" target="_blank">http://www.w3schools.com/js/js_if_else.asp</a>]</p>
<p>‘set interval’ [<a href="http://www.w3schools.com/js/js_timing.asp" target="_blank">http://www.w3schools.com/js/js_timing.asp</a>]</p>
<p>‘document.getElementById’[<a href="http://www.w3schools.com/jsref/met_document_getelementbyid.asp" target="_blank">http://www.w3schools.com/jsref/met_document_getelementbyid.asp</a>].</p>
<p> ‘loop’ [<a href="http://www.w3schools.com/js/js_loop_for.asp" target="_blank">http://www.w3schools.com/js/js_loop_for.asp</a>]</p>
</section>
</div>
</div>
</div>
<a href="./coding.html" class="navigation navigation-prev " aria-label="Previous page: coding"><i class="fa fa-angle-left"></i></a>
<a href="./display.html" class="navigation navigation-next " aria-label="Next page: display"><i class="fa fa-angle-right"></i></a>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/mode-javascript.js"></script>
<script src="gitbook/jsrepl/jsrepl.js" id="jsrepl-script"></script>
<script src="gitbook/app.js"></script>
<script src="gitbook/plugins/gitbook-plugin-mixpanel/plugin.js"></script>
<script src="http://cdn.mathjax.org/mathjax/2.0-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script src="gitbook/plugins/gitbook-plugin-mathjax/plugin.js"></script>
<script>
require(["gitbook"], function(gitbook) {
var config = {};
gitbook.start(config);
});
</script>
</body>
</html>