-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathreference.html
218 lines (216 loc) · 12.2 KB
/
reference.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Reference | Involt - Arduino to html prototyping framework for designers.</title>
<meta content="Detailed reference of Involt HTML UI framework elements. Involt converts CSS classes and generates element with automatic communication." name="description"></meta>
<meta content="hardware prototyping, software to hardware, arduino, html, arduino to html, framework, jquery, chrome app, physical computing, communication" name="keywords"></meta>
<meta content="width=device-width, initial-scale=1" name="viewport"></meta>
<link rel="shortcut icon" type="image/png" href="favicon.png"/>
<link rel="stylesheet" type="text/css" href="css/style.css">
<!--<script src="js/less.js"></script>-->
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,300,700|Source+Code+Pro:400' rel='stylesheet' type='text/css'>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-69535393-1', 'auto');
ga('send', 'pageview');
</script>
</head>
<body>
<header>
<div class="container-head">
<a href="index.html" class="logo"><img src="img/logo.svg" alt=""></a>
<div class="ham-btn">
<div>
<span></span>
<span></span>
<span></span>
</div>
</div>
<nav>
<a href="index.html">Home</a>
<a href="getting-started.html">Getting started</a>
<a href="examples.html">Examples</a>
<a href="reference.html">Reference</a>
<a href="about.html">About</a>
<a href="https://github.com/Involt/Involt">Github</a>
</nav>
</div>
</header>
<div class="bg-gray">
<div class="container">
<div class="sidebar reference">
<h2>UI Elements:</h2>
<div>
<a href="#read-data">Read data</a>
<p>
<a href="#show">Show</a>
<a href="#bar">Bar</a>
<a href="#knob">Knob</a>
<a href="#value">Value</a>
</p>
</div>
<div>
<a href="#send-data">Send data</a>
<p>
<a href="#button">Button</a>
<a href="#toggle">Toggle</a>
<a href="#switch">Switch</a>
<a href="#increase">Increase</a>
<a href="#decrease">Decrease</a>
<a href="#rangeslider">Rangeslider</a>
<a href="#hover">Hover</a>
<a href="#knob-send">Knob-send</a>
<a href="#involt-cta">Involt-cta</a>
</p>
</div>
<div>
<a href="#html-inputs">HTML inputs and forms</a>
<p>
<a href="#involt-input">Involt-input</a>
<a href="#involt-submit">Involt-submit</a>
</p>
</div>
</div>
<main>
<h3>Reference</h3>
<p><b>Before using the reference start from <a href="getting-started.html">Getting started tutorial</a>.</b> For JQuery methods and Javascript reference check <a href="getting-started/jquery.html">JQuery</a> page.</p>
<h3 id="read-data">Read data</h3>
<!-- -->
<h4 id="show">Show</h4>
<p>Display the analog pin value or received string.</p>
<div class="code syntax"><p>ard show [pin]</p></div>
<div class="code html"><div class="ard show A0"></div></div>
<!-- -->
<h4 id="bar">Bar</h4>
<p>Horizontal bar for value of analog pin. Width of bar value is automatically scaled to CSS width of element. For scaling the value use Arduino map function. Add the <span>label-constant</span> class to show the value in constant position.</p>
<div class="code syntax"><p>ard bar [pin] [range]</p></div>
<div class="code html"><div class="ard bar A0 range-0-1024"></div></div>
<!-- -->
<h4 id="knob">Knob</h4>
<p>Knob that shows analog value. Based on <a href="https://github.com/aterrien/jQuery-Knob">JQuery Knob plugin</a> by Anthony Terrien. You can add the <span>data-</span> attributes as described in plugin to change parameters of this element.
<div class="code syntax"><p>ard knob [pin] [range]</p></div>
<div class="code html"><div class="ard knob A0 range-0-1024"></div></div>
<!-- -->
<h4 id="value">Value</h4>
<p>Set html object value attribute to received data.</p>
<div class="code syntax"><p>ard value [pin]</p></div>
<div class="code html"><input type="text" class="ard value A0"></div>
<h3 id="send-data">Send data</h3>
<!-- -->
<h4 id="button">Button</h4>
<p>The most basic UI element of Involt. Send the value (numeric or string) to target pin when button is pressed. It can be any HTML object (<span>div</span> etc.).</p>
<div class="code syntax"><p>ard button [pin] [value]</p></div>
<div class="code html"><button class="ard button P5 value-100"></button></div>
<!-- -->
<h4 id="toggle">Toggle</h4>
<p>Toggle pin between <span>[value1]</span> and <span>[value2]</span>. <span>[value1]</span> is also beginning state on startup (should be declared in <span>void setup( )</span> ). By not defining the values it will become 0/1 switch.</p>
<div class="code syntax"><p>ard toggle [pin] [value1-value2]</p></div>
<div class="code html"><button class="ard toggle P5 value-50-100"></button></div>
<!-- -->
<h4 id="switch">Switch</h4>
<p>Toggle between two values with mobile-like switch. To start with active state add <span>active</span> class.</p>
<div class="code syntax"><p>ard switch [pin] [inactive-active]</p></div>
<div class="code html"><div class="ard switch P5 value-0-255"></div></div>
<!-- -->
<h4 id="increase">Increase</h4>
<p>Increase pin value by <span>[step]</span>. <span>[range]</span> is limit of value. Works with decrease but both need to have same <span>[startvalue]</span>. You can add in void setup the <span>[startvalue]</span> (this is not required).</p>
<div class="code syntax"><p>ard increase [pin] [startvalue] [range] [step]</p></div>
<div class="code html"><button class="ard increase P5 value-100 range-0-255 step-10"></button></div>
<!-- -->
<h4 id="decrease">Decrease</h4>
<p>Decrease pin value by <span>[step]</span>. <span>[range]</span> is limits of value. Works with increase but both need to have same <span>[startvalue]</span>. You can add in void setup the <span>[startvalue]</span> (this is not required).</p>
<div class="code syntax"><p>ard decrease [pin] [startvalue] [range] [step]</p></div>
<div class="code html"><button class="ard decrease P5 value-100 range-0-255 step-10"></button></div>
<!-- -->
<h4 id="rangeslider">Rangeslider</h4>
<p>JQuery based slider with <a href="http://refreshless.com/nouislider/">noUiSlider</a> plugin. The value is displayed inside a tooltip over object. Add the <span>label-constant</span> class to show the value in constant position. To access the JQuery object use <span>.rangeslider>.slider</span> selector, for more info read the plugin documentation. To send the values in real time, not only on release add the <span>fluid</span> class (may cause buffer overloads so <span>step-1</span> is not recommended in this case).</p>
<p>For plain HTML rangeslider use involt-input element.</p>
<div class="code syntax"><p>ard rangeslider [pin] [startvalue] [range] [step]</p></div>
<div class="code html"><div class="ard rangeslider P5 value-0 range-0-255 step-5"></div>;</div>
<!-- -->
<h4 id="hover">Hover</h4>
<p>Hover the element to send value. To combine hover with other Involt element you can simply use this as parent of target in html.</p>
<div class="code syntax"><p>ard hover [pin] [onLeave-onHover]</p></div>
<div class="code html"><div class="ard hover P5 value-0-255"></div></div>
<!-- -->
<h4 id="knob-send">Knob-send</h4>
<p>Simple knob that sends value. This knob is also based on <a href="https://github.com/aterrien/jQuery-Knob">JQuery Knob plugin</a> - you can add plugin <span>data-</span> attributes to this element and they will be transfred to generated object. To send the values in real time, not only on release add the <span>fluid</span> class (may cause buffer overloads so step 1 is not recommended).</p>
<div class="code syntax"><p>ard knob-send [pin] [startvalue] [range] [step]</p></div>
<div class="code html"><div class="ard knob-send P5 value-100 range-0-255 step-1"></div></div>
<!-- -->
<h4 id="involt-cta">Button-cta</h4>
<p>Simple call to action for triggering functions in device.</p>
<div class="code syntax"><p>ard button-cta [functionName]</p></div>
<div class="code html"><button class="ard button-cta fn-functionName"></button></div>
<h3 id="html-inputs">HTML inputs & forms</h3>
<!-- -->
<h4 id="involt-input">Involt-input</h4>
<p>Handle the HTML inputs. The data is sent on input change. Remember that <span>parameters</span> can be defined as classes and HTML attributes.</p>
<p>Supported inputs: <span>text, range, number, checkbox, radio, select</span></p>
<div class="code syntax"><p>ard involt-input [parameters]</p></div>
<div class="code html">
<input type="text" class="ard involt-input S0"> <br><br>
<input type="number" class="ard involt-input P10"> <br><br>
<input type="checkbox" class="ard involt-input" pin="P9" value="0-255"> <br><br>
<input type="range" class="ard involt-input P10" min="0" max="100" step="10" value="50"> <br><br>
<input type="radio" name="demo" class="ard involt-input P14" value="0"> <br>
<input type="radio" name="demo" class="ard involt-input P14" value="1"> <br><br>
<select class="ard involt-input" pin="P13"> <br>
<option value="0">0</option><br>
<option value="100">100</option><br>
<option value="255">255</option><br>
</select><br>
</div>
<!-- -->
<h4 id="involt-submit">Involt-submit</h4>
<p>Use involt-submit inside HTML form to send form inputs values only on submitting by this button. The <span>functionName</span> is not required, the function itself is triggered after all values are passed to device. The <span>type=""button"</span> is required.</p>
<p>UI elements affected: <span>involt-input, knob-send, rangeslider.</span></p>
<div class="code syntax"><p>ard involt-submit [functionName]</p></div>
<div class="code html"><button type="button" class="ard involt-submit fn-functionName"></button></div>
<p>Quick example:</p>
<div class="code html">
<div class="code-m">
<input type="text" class="ard involt-input S0"> //Send value when it's changed
<br><br>
<form>
<p><input type="text" class="ard involt-input S0"> //Changing will not send the value immediately.</p>
<p><button type="button" class="ard involt-submit">Submit</button> //Click to send value</p>
</form>
</div>
</div>
</main>
</div>
</div>
<footer>
<div class="container">
<div class="column">
<img src="img/ico1.svg" class="ico-small" alt="">
<div class="footer-txt">
Involt was made to quickly create interactive objects with software to hardware communication by using HTML and CSS. The goal is to help you to overcome the obstacles at prototyping stage.
</div>
<a href="about.html">Read more</a>
</div>
<div class="column">
<img src="img/ico2.svg" class="ico-small" alt="">
<div class="footer-txt">
You can help develop framework on Github. There are new features added with each version. To see the progress of development check the changelog. Involt is under MIT license.
</div>
<a href="https://github.com/Involt/Involt/wiki/Changelog">See the Changelog</a>
</div>
<div class="column">
<img src="img/ico3.svg" class="ico-small" alt="">
<div class="footer-txt">
Used Involt and enjoyed it? Do you have any questions or suggestions? Help by sending feedback directly via mail.
</div>
<a href="mailto:ernestwarzocha@gmail.com">ernestwarzocha@gmail.com</a>
</div>
</div>
</footer>
<script src="js/jq-ui.js"></script>
</body>
</html>