-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsourcecode.html
More file actions
437 lines (276 loc) · 14.9 KB
/
sourcecode.html
File metadata and controls
437 lines (276 loc) · 14.9 KB
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
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
<!DOCTYPE HTML>
<!--
Editorial by HTML5 UP
html5up.net | @ajlkn
Free for personal and commercial use under the CCA 3.0 license (html5up.net/license)
-->
<html>
<head>
<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="theme-color" content="#ffffff">
<title>ElectronicBlocks</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<!--[if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
<link rel="stylesheet" href="assets/css/main.css" />
<!--[if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
<!--[if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
</head>
<body>
<!-- Wrapper -->
<div id="wrapper">
<!-- Main -->
<div id="main">
<div class="inner">
<!-- Header -->
<header id="header">
<a href="index.html" class="logo"><strong>Its all about electronics</strong> </a>
<ul class="icons">
<li><a href="https://mobile.twitter.com/im_arpit7" target="_blank" class="icon fa-twitter"><span class="label">Twitter</span></a></li>
<li><a href="https://www.facebook.com/arpit.goswami.169" target="_blank" class="icon fa-facebook"><span class="label">Facebook</span></a></li>
<!--<li><a href="#" class="icon fa-snapchat-ghost"><span class="label">Snapchat</span></a></li>-->
<li><a href="https://www.instagram.com/i_m_arpit7/?hl=en" target="_blank" class="icon fa-instagram"><span class="label">Instagram</span></a></li>
<!--<li><a href="#" class="icon fa-medium"><span class="label">Medium</span></a></li>-->
</ul>
</header>
<!-- Content -->
<section>
<header class="main">
<h1>SOURCE CODES OF ARDUINO PROJECTS
</h1>
</header>
<span class="image main"><img src="images/source%20code.jpg" alt="" /></span>
<hr class="major" />
<h2>1. BLINKING DEFAULT ARDUINO LED</h2>
<p>// program to blink led <br/>
int ledpin=13;<br/>
void setup() {<br/>
pinMode(ledpin,OUTPUT);<br/>
}<br/>
void loop() {<br/>
digitalWrite(ledpin,HIGH);<br/>
delay(500);<br/>
digitalWrite(ledpin,LOW);<br/>
delay(500);<br/>
}.</p>
<hr class="major" />
<h2>2. CODE TO CONTROL LED BRIGHTNESS</h2>
<p>int switchpin=8;<br/>
int ledpin=11;<br/>
boolean lastButton=LOW;<br/>
boolean currentbutton=LOW;<br/>
int ledlvl=0;<br/>
boolean debounce(boolean last)<br/>
{boolean current=digitalRead(switchpin);<br/>
if(last!=current)<br/>
{delay(5);<br/>
current=digitalRead(switchpin);}<br/>
return current;<br/>
}<br/>
void setup()<br/>
{pinMode(switchpin,INPUT);<br/>
pinMode(ledpin,OUTPUT);<br/>
}<br/>
void loop()<br/>
{currentbutton=debounce(lastButton);<br/>
if(currentbutton==HIGH&&lastButton==LOW)<br/>
{ledlvl=ledlvl+51;<br/>
}<br/>
lastButton=currentbutton;<br/>
if(ledlvl>255)<br/>
ledlvl=0;<br/>
analogWrite(ledpin,ledlvl);<br/>
}<br/>
</p>
<!-- gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg-->
<hr class="major" />
<h2>3. LED PATTERN USING SWITCH</h2>
<p>//program to change the pattern of led blinking<br/>
int ledpin1=13;<br/>
int ledpin2=12;<br/>
int switchpin=8;<br/>
boolean lastButton=LOW;<br/>
boolean currentbutton=LOW; <br/>
boolean check=false;<br/>
boolean debounce(boolean last)<br/>
{boolean current=digitalRead(switchpin);<br/>
if(last!=current)<br/>
{delay(5);<br/>
current=digitalRead(switchpin);}<br/>
return current;<br/>
}<br/>
void setup()<br/>
{pinMode(switchpin,INPUT);<br/>
pinMode(ledpin1,OUTPUT);<br/>
pinMode(ledpin2,OUTPUT);<br/>
}<br/>
void loop()<br/>
{currentbutton=debounce(lastButton);<br/>
if(currentbutton==HIGH&&lastButton==LOW)<br/>
{check=!check;<br/>
}<br/>
if(check==false)<br/>
{digitalWrite(ledpin1,HIGH);<br/>
digitalWrite(ledpin2,HIGH);}<br/>
if(check==true)<br/>
{digitalWrite(ledpin1,HIGH);<br/>
digitalWrite(ledpin2,LOW);<br/>
delay(50);<br/>
digitalWrite(ledpin1,LOW);<br/>
digitalWrite(ledpin2,HIGH);<br/>
delay(50);<br/>
}<br/>
lastButton=currentbutton;<br/>
}<br/>
</p>
<!-- gggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg-->
<hr class="major" />
<h2>4.LED BLINKING USING SWITCH</h2>
<p>//THIS PROGRAM USES DEBOUNCE FUNCTION TO AVOID THE DELAY CAUSE ON PRESSING THE SWITCHING...(IT IS PREFER TO LEARN THE WORKING OF BUTTON SWITCH)<br/>
int switchpin=8;<br/>
int ledpin=13;<br/>
boolean lastButton=LOW;<br/>
boolean currentbutton=LOW;<br/>
boolean ledon=false;<br/>
boolean debounce(boolean last)<br/>
{boolean current=digitalRead(switchpin);<br/>
if(last!=current)<br/>
{delay(5);<br/>
current=digitalRead(switchpin);}<br/>
return current;<br/>
}<br/>
void setup()<br/>
{pinMode(switchpin,INPUT);<br/>
pinMode(ledpin,OUTPUT);<br/>
}<br/>
void loop()<br/>
{currentbutton=debounce(lastButton);<br/>
if(currentbutton==HIGH&&lastButton==LOW)<br/>
{ledon=!ledon;<br/>
}<br/>
lastButton=currentbutton;<br/>
digitalWrite(ledpin,ledon);<br/>
}<br/>
</p>
<!-- <p>Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis. Praesent rutrum sem diam, vitae egestas enim auctor sit amet. Pellentesque leo mauris, consectetur id ipsum sit amet, fersapien risus, commodo eget turpis at, elementum convallis elit. Pellentesque enim turpis, hendrerit tristique lorem ipsum dolor.</p>
<hr class="major" />
<h2>Lorem aliquam bibendum</h2>
<p>Donec eget ex magna. Interdum et malesuada fames ac ante ipsum primis in faucibus. Pellentesque venenatis dolor imperdiet dolor mattis sagittis. Praesent rutrum sem diam, vitae egestas enim auctor sit amet. Pellentesque leo mauris, consectetur id ipsum sit amet, fergiat. Pellentesque in mi eu massa lacinia malesuada et a elit. Donec urna ex, lacinia in purus ac, pretium pulvinar mauris. Curabitur sapien risus, commodo eget turpis at, elementum convallis elit. Pellentesque enim turpis, hendrerit.</p>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis dapibus rutrum facilisis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Etiam tristique libero eu nibh porttitor fermentum. Nullam venenatis erat id vehicula viverra. Nunc ultrices eros ut ultricies condimentum. Mauris risus lacus, blandit sit amet venenatis non, bibendum vitae dolor. Nunc lorem mauris, fringilla in aliquam at, euismod in lectus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. In non lorem sit amet elit placerat maximus. Pellentesque aliquam maximus risus, vel sed vehicula.</p>-->
</section>
</div>
</div>
<!-- Sidebar -->
<div id="sidebar">
<div class="inner">
<!-- Search -->
<section id="search" class="alt">
<form method="get" action="http://www.google.com">
<input type="text" name="query" id="query" placeholder="Search" />
</form>
</section>
<!-- Menu --> <nav id="menu">
<header class="major">
<h2>Menu</h2>
</header>
<ul>
<!-- <li><a href="index.html">Homepage</a></li>
<li><a href="generic.html">Generic</a></li>
<li><a href="elements.html">Elements</a></li>
<li>
<span class="opener">Submenu</span>
<ul>
<li><a href="#">Lorem Dolor</a></li>
<li><a href="#">Ipsum Adipiscing</a></li>
<li><a href="#">Tempus Magna</a></li>
<li><a href="#">Feugiat Veroeros</a></li>
</ul>
</li>
<li><a href="#">Etiam Dolore</a></li>
<li><a href="#">Adipiscing</a></li>
<li>
<span class="opener">Another Submenu</span>
<ul>
<li><a href="#">Lorem Dolor</a></li>
<li><a href="#">Ipsum Adipiscing</a></li>
<li><a href="#">Tempus Magna</a></li>
<li><a href="#">Feugiat Veroeros</a></li>
</ul>
</li>
<li><a href="#">Maximus Erat</a></li>
<li><a href="#">Sapien Mauris</a></li>
<li><a href="#">Amet Lacinia</a></li>
</ul>
</nav>-->
<!-- copied part -->
<li><a href="index.html">Homepage</a></li>
<li><a href="generic.html">Recent projects</a></li>
<li><a href="video.html">project videos</a></li>
<li>
<a href="images.html"> project images</a>
<!-- <ul>
<li><a href="#">project videos</a></li>
<li><a href="#">project images</a></li>
<li><a href="#">Tempus Magna</a></li>
<li><a href="#">Feugiat Veroeros</a></li>
</ul>-->
</li>
<li><a href="about us.html">about us</a></li>
<li><a href="otherlinks.html">other links</a></li>
<li>
</li>
<!-- Section -->
<section>
<header class="major">
<h2>PEOPLE</h2>
</header>
<div class="mini-posts">
<article>
<a href="http://arpitgoswami.zohosites.com/" class="image"><img src="images/LRM_EXPORT_20170126_111745.jpg" alt="" /></a>
<p><strong>ARPIT GOSWAMI</strong>-linux geek working on android OEMs and bootloaders.</p>
</article>
<article>
<a href="#" class="image"><img src="images/IMG-20161230-WA0000.jpg" alt="" /></a>
<p><strong>PRATAYA AMRIT </strong>-works on embedded projetcs.</p>
</article>
<article>
<a href="#" class="image"><img src="images/1601494_579344955532041_5689804113905199435_n.jpg" alt="" /></a>
<p><strong>VEDANG SATI </strong>-founder at wonder phy6.</p>
</article>
</div>
<!-- <ul class="actions">
<li><a href="#" class="button">More</a></li>-->
</ul>
</section>
<!-- Section -->
<section>
<header class="major">
<h2>Contact Us</h2>
</header>
<p>for any furthur query of above related topics,suggestion or working with us in our recent projects.</p>
<ul class="contact">
<li class="fa-envelope-o"><a href="#">QUERY@ELECTRONICBLOCKS.IN</a></li>
<li class="fa-phone">9891077327</li>
<li class="fa-home">Delhi<br />
PIN CODE 110053</li>
</ul>
</section>
<!-- Footer -->
<footer id="footer">
<p class="copyright">©ElectronicBlocks. All rights reserved. .</p>
</footer>
</div>
</div>
</div>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/skel.min.js"></script>
<script src="assets/js/util.js"></script>
<!--[if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
<script src="assets/js/main.js"></script>
</body>
</html>