add arduino-0018-linux (32 bit)
This commit is contained in:
parent
7fa52a235a
commit
297de2a227
425 changed files with 64818 additions and 0 deletions
232
arduino-0018-linux/reference/ASCIIchart.html
Normal file
232
arduino-0018-linux/reference/ASCIIchart.html
Normal file
|
@ -0,0 +1,232 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ASCIIchart </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>ASCII chart</h2>
|
||||
<p>The <a class='urllink' href='http://en.wikipedia.org/wiki/ASCII_chart' rel='nofollow'>ASCII</a> (American Standard Code for Information Interchange) encoding dates to the 1960's. It is the standard way that text is encoded numerically.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Note that the first 32 characters (0-31) are non-printing characters, often called control characters. The more useful characters have been labeled.
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
<table width='80%' border='0' cellpadding='5' cellspacing='0'><tr><td width='20%' valign='top'>
|
||||
<pre>
|
||||
DEC Character
|
||||
Value
|
||||
|
||||
0 null
|
||||
1
|
||||
2
|
||||
3
|
||||
4
|
||||
5
|
||||
6
|
||||
7
|
||||
8
|
||||
9 tab
|
||||
10 line feed
|
||||
11
|
||||
12
|
||||
13 carriage return
|
||||
14
|
||||
15
|
||||
16
|
||||
17
|
||||
18
|
||||
19
|
||||
20
|
||||
21
|
||||
22
|
||||
23
|
||||
24
|
||||
25
|
||||
26
|
||||
27
|
||||
28
|
||||
29
|
||||
30
|
||||
31
|
||||
|
||||
|
||||
|
||||
</pre></td><td width='18%' valign='top'>
|
||||
<pre>
|
||||
DEC Character
|
||||
Value
|
||||
|
||||
32 space
|
||||
33 !
|
||||
34 "
|
||||
35 #
|
||||
36 $
|
||||
37 %
|
||||
38 &
|
||||
39 '
|
||||
40 (
|
||||
41 )
|
||||
42 *
|
||||
43 +
|
||||
44 ,
|
||||
45 -
|
||||
46 .
|
||||
47 /
|
||||
48 0
|
||||
49 1
|
||||
50 2
|
||||
51 3
|
||||
52 4
|
||||
53 5
|
||||
54 6
|
||||
55 7
|
||||
56 8
|
||||
57 9
|
||||
58 :
|
||||
59 ;
|
||||
60 <
|
||||
61 =
|
||||
62 >
|
||||
63 ?
|
||||
|
||||
|
||||
|
||||
</pre></td><td width='18%' valign='top'>
|
||||
<pre>
|
||||
DEC Character
|
||||
Value
|
||||
|
||||
64 @
|
||||
65 A
|
||||
66 B
|
||||
67 C
|
||||
68 D
|
||||
69 E
|
||||
70 F
|
||||
71 G
|
||||
72 H
|
||||
73 I
|
||||
74 J
|
||||
75 K
|
||||
76 L
|
||||
77 M
|
||||
78 N
|
||||
79 O
|
||||
80 P
|
||||
81 Q
|
||||
82 R
|
||||
83 S
|
||||
84 T
|
||||
85 U
|
||||
86 V
|
||||
87 W
|
||||
88 X
|
||||
89 Y
|
||||
90 Z
|
||||
91 [
|
||||
92 \
|
||||
93 ]
|
||||
94 ^
|
||||
95 _
|
||||
|
||||
|
||||
|
||||
</pre></td><td width='18%' valign='top'>
|
||||
<pre>
|
||||
DEC Character
|
||||
Value
|
||||
|
||||
96 `
|
||||
97 a
|
||||
98 b
|
||||
99 c
|
||||
100 d
|
||||
101 e
|
||||
102 f
|
||||
103 g
|
||||
104 h
|
||||
105 i
|
||||
106 j
|
||||
107 k
|
||||
108 l
|
||||
109 m
|
||||
110 n
|
||||
111 o
|
||||
112 p
|
||||
113 q
|
||||
114 r
|
||||
115 s
|
||||
116 t
|
||||
117 u
|
||||
118 v
|
||||
119 w
|
||||
120 x
|
||||
121 y
|
||||
122 z
|
||||
123 {
|
||||
124 |
|
||||
125 }
|
||||
126 ~
|
||||
127
|
||||
|
||||
</pre></td></tr></table>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
89
arduino-0018-linux/reference/Abs.html
Normal file
89
arduino-0018-linux/reference/Abs.html
Normal file
|
@ -0,0 +1,89 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Abs </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>abs(x)</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Computes the absolute value of a number.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>x: the number
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p><strong>x</strong>: if <strong>x</strong> is greater than or equal to 0.
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>-x</strong>: if <strong>x</strong> is less than 0.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Warning</h4>
|
||||
<p>Because of the way the abs() function is implemented, avoid using other functions inside the brackets, it may lead to incorrect results.
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
abs(a++); // avoid this - yields incorrect results
|
||||
|
||||
a++; // use this instead -
|
||||
abs(a); // keep other math outside the function
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
107
arduino-0018-linux/reference/AnalogRead.html
Normal file
107
arduino-0018-linux/reference/AnalogRead.html
Normal file
|
@ -0,0 +1,107 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - AnalogRead </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>analogRead()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Reads the value from the specified analog pin. The Arduino board contains a 6 channel (8 channels on the Mini and Nano), 10-bit analog to digital converter. This means that it will map input voltages between 0 and 5 volts into integer values between 0 and 1023. This yields a resolution between readings of: 5 volts / 1024 units or, .0049 volts (4.9 mV) per unit.
|
||||
</p>
|
||||
<p class='vspace'></p><p>It takes about 100 us (0.0001 s) to read an analog input, so the maximum reading rate is about 10,000 times a second.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>analogRead(pin)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>pin: the number of the analog input pin to read from (0 to 5 on most boards, 0 to 7 on the Mini and Nano)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>int (0 to 1023)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Note</h4>
|
||||
<p>If the analog input pin is not connected to anything, the value returned by analogRead() will fluctuate based on a number of factors (e.g. the values of the other analog inputs, how close your hand is to the board, etc.).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
int analogPin = 3; // potentiometer wiper (middle terminal) connected to analog pin 3
|
||||
// outside leads to ground and +5V
|
||||
int val = 0; // variable to store the value read
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600); // setup serial
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
val = analogRead(analogPin); // read the input pin
|
||||
Serial.println(val); // debug value
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='AnalogWrite.html'>analogWrite</a>()
|
||||
</li><li><a class='wikilink' href='http://arduino.cc/en/Tutorial/AnalogInputPins'>Tutorial: Analog Input Pins</a>
|
||||
</li><li><a class='wikilink' href='http://arduino.cc/en/Tutorial/RCtime'>RCtime</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
99
arduino-0018-linux/reference/AnalogReference.html
Normal file
99
arduino-0018-linux/reference/AnalogReference.html
Normal file
|
@ -0,0 +1,99 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - AnalogReference </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>analogReference(type)</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Configures the reference voltage used for analog input. The analogRead() function will return 1023 for an input equal to the reference voltage. The options are:
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li>DEFAULT: the default analog reference of 5 volts.
|
||||
</li><li>INTERNAL: an built-in reference, equal to 1.1 volts on the <span class='wikiword'>ATmega168</span> and 2.56 volts on the <span class='wikiword'>ATmega8</span>.
|
||||
</li><li>EXTERNAL: the voltage applied to the AREF pin is used as the reference.
|
||||
</li></ul><p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>type: which type of reference to use (DEFAULT, INTERNAL, or EXTERNAL).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>None.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Warning</h4>
|
||||
<p>It is a good idea to connect external voltages to the AREF pin through a 5K resistor. This will prevent possible internal damage to the Atmega chip if analogReference() software settings are incompatible with the current hardware setup. Note that the resistor will alter the voltage that gets used as the reference because there is an internal 32K resistor on the AREF pin. The two act as a voltage divider, so, for example, 2.5V applied through the resistor will yield ~2.2V at the AREF pin.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Connecting external voltages through a resistor makes it possible to switch the AREF voltage on the fly, say from the 5 volt DEFAULT setting, to a 3.3 volt EXTERNAL setting (and applied voltage), without the hardware setup affecting either ADC configuration.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Use of the AREF pin</h4>
|
||||
<p>The voltage applied to the AREF pin directly governs the ADC and sets the voltage at which the ADC will report its highest reading, 1023. Lower voltages applied to ADC (analog) pins will be scaled proportionally, so at the DEFAULT setting (5 volt internal connection), 2.5 volts on an analog pin will report approximately 512.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The default configuration on all Arduino implementations is to have nothing connected externally to the AREF pin (Atmega pin 21). In this case the DEFAULT analogReference software setting connects the AVCC voltage, internally, to the AREF pin. This appears to be a low impedance connection (high current) and voltages, other than AVCC, applied (erroneously) to the AREF pin in the DEFAULT setting could damage the ATMEGA chip.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The AREF pin may also be connected internally to an (internal) 1.1 volt source (or 2.56 on the <span class='wikiword'>ATmega8</span>) with analogReference(INTERNAL). With this setting voltages applied to the ADC (analog) pins that are at or above the reference will report 1023 when read with analogRead. Lower voltages will report proportional values, so 0.55 volts will report about 512.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The connection between the 1.1 volt source and the AREF pin is a very high impedance (low current) connection, so that reading the 1.1 (internally supplied) voltage at the AREF pin may only be done with a more expensive, high-impedance multimeter. An external voltage applied (erroneously) to AREF pin while using the INTERNAL setting will not damage the chip, but will totally override the 1.1 volt source, and ADC readings will be governed by the external voltage. It is still desirable to connect any external voltage to the AREF pin however, through a 5K resistor to avoid the problem cited above.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The correct software setting for using the AREF pin with an external voltage is analogReference(EXTERNAL). This disconnects both of the internal references and the voltage applied externally to the AREF pin sets the reference voltage for the ADC.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='http://arduino.cc/en/Tutorial/AnalogInputPins'>Description of the analog input pins</a>
|
||||
</li><li><a class='wikilink' href='AnalogRead.html'>analogRead</a>()
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
115
arduino-0018-linux/reference/AnalogWrite.html
Normal file
115
arduino-0018-linux/reference/AnalogWrite.html
Normal file
|
@ -0,0 +1,115 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - AnalogWrite </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>analogWrite()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Writes an analog value (<a class='wikilink' href='http://arduino.cc/en/Tutorial/PWM'>PWM wave</a>) to a pin. Can be used to light a LED at varying brightnesses or drive a motor at various speeds. After a call to <strong>analogWrite()</strong>, the pin will generate a steady square wave of the specified duty cycle until the next call to <strong>analogWrite()</strong> (or a call to <strong>digitalRead()</strong> or <strong>digitalWrite()</strong> on the same pin). The frequency of the PWM signal is approximately 490 Hz.
|
||||
</p>
|
||||
<p class='vspace'></p><p>On newer Arduino boards (including the Mini and BT) with the <span class='wikiword'>ATmega168</span> chip, this function works on pins 3, 5, 6, 9, 10, and 11. Older USB and serial Arduino boards with an <span class='wikiword'>ATmega8</span> only support analogWrite() on pins 9, 10, and 11.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>analogWrite(pin, value)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>pin: the pin to write to.
|
||||
</p>
|
||||
<p class='vspace'></p><p>value: the duty cycle: between 0 (always off) and 255 (always on).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>nothing
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Notes and Known Issues</h4>
|
||||
<p><em>analogWrite</em> has nothing whatsoever to do with the analog pins or <em>analogRead</em>.
|
||||
</p>
|
||||
<p class='vspace'></p><p>You do not need to call pinMode() to set the pin as an output before calling analogWrite().
|
||||
</p>
|
||||
<p class='vspace'></p><p>The PWM outputs generated on pins 5 and 6 will have higher-than-expected duty cycles. This is because of interactions with the millis() and delay() functions, which share the same internal timer used to generate those PWM outputs. This will be noticed mostly on low duty-cycle settings (e.g 0 - 10) and may result in analogWrite(x, 0) not fully turning off the output on pins 5 & 6, as one would expect.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<p>Sets the output to the LED proportional to the value read from the potentiometer.
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
int ledPin = 9; // LED connected to digital pin 9
|
||||
int analogPin = 3; // potentiometer connected to analog pin 3
|
||||
int val = 0; // variable to store the read value
|
||||
|
||||
void setup()
|
||||
{
|
||||
pinMode(ledPin, OUTPUT); // sets the pin as output
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
val = analogRead(analogPin); // read the input pin
|
||||
analogWrite(ledPin, val / 4); // analogRead values go from 0 to 1023, analogWrite values from 0 to 255
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='AnalogRead.html'>analogRead</a>()
|
||||
</li><li><a class='wikilink' href='http://arduino.cc/en/Tutorial/PWM'>Tutorial: PWM</a>
|
||||
</li><li><a class='urllink' href='http://www.arduino.cc/playground/Main/TimerPWMCheatsheet' rel='nofollow'>Adjusting Arduino PWM Frequencies</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
100
arduino-0018-linux/reference/Arithmetic.html
Normal file
100
arduino-0018-linux/reference/Arithmetic.html
Normal file
|
@ -0,0 +1,100 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Arithmetic </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Addition, Subtraction, Multiplication, & Division</h2>
|
||||
<h4>Description</h4>
|
||||
<p>These operators return the sum, difference, product, or quotient (respectively) of the two operands. The operation is conducted using the data type of the operands, so, for example, <code>9 / 4</code> gives <code>2</code> since 9 and 4 are ints. This also means that the operation can overflow if the result is larger than that which can be stored in the data type (e.g. adding 1 to an <a class='wikilink' href='Int.html'>int</a> with the value 32,767 gives -32,768). If the operands are of different types, the "larger" type is used for the calculation.
|
||||
</p>
|
||||
<p class='vspace'></p><p>If one of the numbers (operands) are of the type <strong>float</strong> or of type <strong>double</strong>, floating point math will be used for the calculation.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Examples</h4>
|
||||
<pre>
|
||||
y = y + 3;
|
||||
x = x - 7;
|
||||
i = j * 6;
|
||||
r = r / 5;
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<pre>
|
||||
result = value1 + value2;
|
||||
result = value1 - value2;
|
||||
result = value1 * value2;
|
||||
result = value1 / value2;
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Parameters:</h4>
|
||||
<p>value1: any variable or constant
|
||||
</p>
|
||||
<p class='vspace'></p><p>value2: any variable or constant
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Programming Tips:</h4>
|
||||
<ul><li>Know that <a class='wikilink' href='IntegerConstants.html'>integer constants</a> default to <a class='wikilink' href='Int.html'>int</a>, so some constant calculations may overflow (e.g. 60 * 1000 will yield a negative result).
|
||||
<p class='vspace'></p></li><li>Choose variable sizes that are large enough to hold the largest results from your calculations
|
||||
<p class='vspace'></p></li><li>Know at what point your variable will "roll over" and also what happens in the other direction e.g. (0 - 1) OR (0 - - 32768)
|
||||
<p class='vspace'></p></li><li>For math that requires fractions, use float variables, but be aware of their drawbacks: large size, slow computation speeds
|
||||
<p class='vspace'></p></li><li>Use the cast operator e.g. (int)myFloat to convert one variable type to another on the fly.
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
119
arduino-0018-linux/reference/Array.html
Normal file
119
arduino-0018-linux/reference/Array.html
Normal file
|
@ -0,0 +1,119 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Array </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Arrays</h2>
|
||||
<p>An array is a collection of variables that are accessed with an index number. Arrays in the C programming language, on which Arduino is based, can be complicated, but using simple arrays is relatively straightforward.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Creating (Declaring) an Array</h4>
|
||||
<p>All of the methods below are valid ways to create (declare) an array.
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
int myInts[6];
|
||||
int myPins[] = {2, 4, 8, 3, 6};
|
||||
int mySensVals[6] = {2, 4, -8, 3, 2};
|
||||
char message[6] = "hello";
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p>You can declare an array without initializing it as in myInts.<br /><br />In myPins we declare an array without explicitly choosing a size. The compiler counts the elements and creates an array of the appropriate size.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Finally you can both initialize and size your array, as in mySensVals. Note that when declaring an array of type char, one more element than your initialization is required, to hold the required null character.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Accessing an Array</h4>
|
||||
<p>Arrays are <strong>zero indexed</strong>, that is, referring to the array initialization above, the first element of the array is at index 0, hence<br /><br /><code>mySensVals[0] == 2, mySensVals[1] == 4,</code> and so forth.
|
||||
</p>
|
||||
<p class='vspace'></p><p>It also means that in an array with ten elements, index nine is the last element. Hence:
|
||||
</p><pre>
|
||||
int myArray[10]={9,3,2,4,3,2,7,8,9,11};
|
||||
// myArray[9] contains 11
|
||||
// myArray[10] is invalid and contains random information (other memory address)
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p>For this reason you should be careful in accessing arrays. Accessing past the end of an array (using an index number greater than your declared array size - 1) is reading from memory that is in use for other purposes. Reading from these locations is probably not going to do much except yield invalid data. Writing to random memory locations is definitely a bad idea and can often lead to unhappy results such as crashes or program malfunction. This can also be a difficult bug to track down.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Unlike BASIC or JAVA, the C compiler does no checking to see if array access is within legal bounds of the array size that you have declared.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>To assign a value to an array:</h4>
|
||||
<pre>
|
||||
mySensVals[0] = 10;
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>To retrieve a value from an array:</h4>
|
||||
<p><code>x = mySensVals[4]</code>;
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Arrays and FOR Loops</h4>
|
||||
<p>Arrays are often manipulated inside <strong>for</strong> loops, where the loop counter is used as the index for each array element. For example, to print the elements of an array over the serial port, you could do something like this:
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
int i;
|
||||
for (i = 0; i < 5; i = i + 1) {
|
||||
Serial.println(myPins[i]);
|
||||
}
|
||||
</pre><h4>Example</h4>
|
||||
<p>For a complete program that demonstrates the use of arrays, see the <a class='urllink' href='http://www.arduino.cc/en/Tutorial/KnightRider' rel='nofollow'>Knight Rider example</a> from the <a class='urllink' href='http://www.arduino.cc/en/Main/LearnArduino' rel='nofollow'>Tutorials</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='urllink' href='VariableDeclaration.html' rel='nofollow'>Variable Declaration</a>
|
||||
</li><li><a class='wikilink' href='PROGMEM.html'>PROGMEM</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
86
arduino-0018-linux/reference/Assignment.html
Normal file
86
arduino-0018-linux/reference/Assignment.html
Normal file
|
@ -0,0 +1,86 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Assignment </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>= assignment operator (single equal sign)</h2>
|
||||
<p>Stores the value to the right of the equal sign in the variable to the left of the equal sign.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The single equal sign in the C programming language is called the assignment operator. It has a different meaning than in algebra class where it indicated an equation or equality. The assignment operator tells the microcontroller to evaluate whatever value or expression is on the right side of the equal sign, and store it in the variable to the left of the equal sign.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre> int sensVal; // declare an integer variable named sensVal
|
||||
senVal = analogRead(0); // store the (digitized) input voltage at analog pin 0 in <span class='wikiword'>SensVal</span>
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Programming Tips</h4>
|
||||
<p>The variable on the left side of the assignment operator ( = sign ) needs to be able to hold the value stored in it. If it is not large enough to hold a value, the value stored in the variable will be incorrect.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Don't confuse the assignment operator [ = ] (single equal sign) with the comparison operator [ == ] (double equal signs), which evaluates whether two expressions are equal.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See Also</h4>
|
||||
<ul><li><a class='wikilink' href='If.html'>if (comparison operators)</a>
|
||||
</li><li><a class='wikilink' href='Char.html'>char</a>
|
||||
</li><li><a class='wikilink' href='Int.html'>int</a>
|
||||
</li><li><a class='wikilink' href='Long.html'>long</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
115
arduino-0018-linux/reference/AttachInterrupt.html
Normal file
115
arduino-0018-linux/reference/AttachInterrupt.html
Normal file
|
@ -0,0 +1,115 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - AttachInterrupt </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>attachInterrupt(interrupt, function, mode)</h2>
|
||||
<p class='vspace'></p><h4>Description</h4>
|
||||
<p>Specifies a function to call when an external interrupt occurs. Replaces any previous function that was attached to the interrupt. Most Arduino boards have two external interrupts: numbers 0 (on digital pin 2) and 1 (on digital pin 3). The Arduino Mega has an additional four: numbers 2 (pin 21), 3 (pin 20), 4 (pin 19), and 5 (pin 18).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p><strong>interrupt</strong>: the number of the interrupt (<em>int</em>)
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>function</strong>: the function to call when the interrupt occurs; this function must take no parameters and return nothing. This function is sometimes referred to as an <em>interrupt service routine.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>mode</strong> defines when the interrupt should be triggered. Four contstants are predefined as valid values:
|
||||
</p><ul><li><strong>LOW</strong> to trigger the interrupt whenever the pin is low,
|
||||
</li><li><strong>CHANGE</strong> to trigger the interrupt whenever the pin changes value
|
||||
</li><li><strong>RISING</strong> to trigger when the pin goes from low to high,
|
||||
</li><li><strong>FALLING</strong> for when the pin goes from high to low.
|
||||
</li></ul><p class='vspace'></p><h4>Returns</h4>
|
||||
<p>none
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Note</h4>
|
||||
<p><em>Inside the attached function, delay() won't work and the value returned by millis() will not increment. Serial data received while in the function may be lost. You should declare as volatile any variables that you modify within the attached function.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Using Interrupts</h4>
|
||||
<p>Interrupts are useful for making things happen automatically in microcontroller programs, and can help solve timing problems. A good task for using an interrupt might be reading a rotary encoder, monitoring user input.
|
||||
</p>
|
||||
<p class='vspace'></p><p>If you wanted to insure that a program always caught the pulses from a rotary encoder, never missing a pulse, it would make it very tricky to write a program to do anything else, because the program would need to constantly poll the sensor lines for the encoder, in order to catch pulses when they occurred. Other sensors have a similar interface dynamic too, such as trying to read a sound sensor that is trying to catch a click, or an infrared slot sensor (photo-interrupter) trying to catch a coin drop. In all of these situations, using an interrupt can free the microcontroller to get some other work done while not missing the doorbell.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>int pin = 13;
|
||||
volatile int state = LOW;
|
||||
|
||||
void setup()
|
||||
{
|
||||
pinMode(pin, OUTPUT);
|
||||
attachInterrupt(0, blink, CHANGE);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
digitalWrite(pin, state);
|
||||
}
|
||||
|
||||
void blink()
|
||||
{
|
||||
state = !state;
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='DetachInterrupt.html'>detachInterrupt</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
85
arduino-0018-linux/reference/BeginSerial.html
Normal file
85
arduino-0018-linux/reference/BeginSerial.html
Normal file
|
@ -0,0 +1,85 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - BeginSerial </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc/">Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav">
|
||||
<p><a class='wikilink' href='Guide_index.html'>Guide</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Tutorial/HomePage'>Tutorials</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Software'>Software</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl' rel='nofollow'>Forum</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/playground/' rel='nofollow'>Playground</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/playground/Projects/ArduinoUsers' rel='nofollow'>Exhibition</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Hacking/HomePage'>Hacking</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/FAQ'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Buy'>Buy</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><a class='wikilink' href='index.html'>Language</a> | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a>
|
||||
</p><h2>beginSerial(speed)</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Initializes the serial port. Should be called from inside <a class='wikilink' href='Setup.html'>setup()</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>speed: the baud rate to use for the serial communication (e.g. 9600 or 19200)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>None
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Note</h4>
|
||||
<p>Serial Arduino boards supports speeds up to 19200 baud. USB boards support up to 115200 baud (with release 0003 and later of the Arduino software).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='SerialAvailable.html'>serialAvailable</a>
|
||||
</li><li><a class='wikilink' href='SerialRead.html'>serialRead</a>
|
||||
</li><li><a class='wikilink' href='SerialWrite.html'>serialWrite</a>
|
||||
</li><li><a class='wikilink' href='PrintByte.html'>printByte</a>
|
||||
</li><li><a class='wikilink' href='PrintString.html'>printString</a>
|
||||
</li><li><a class='wikilink' href='PrintInteger.html'>printInteger</a>
|
||||
</li><li><a class='wikilink' href='PrintHex.html'>printHex</a>
|
||||
</li><li><a class='wikilink' href='PrintOctal.html'>printOctal</a>
|
||||
</li><li><a class='wikilink' href='PrintBinary.html'>printBinary</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='RecentChanges.html'>Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
85
arduino-0018-linux/reference/Bit.html
Normal file
85
arduino-0018-linux/reference/Bit.html
Normal file
|
@ -0,0 +1,85 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Bit </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>bit()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Computes the value of the specified bit (bit 0 is 1, bit 1 is 2, bit 2 is 4, etc.).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>bit(n)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>n: the bit whose value to compute
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>the value of the bit
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='BitRead.html'>bitRead</a>()
|
||||
</li><li><a class='wikilink' href='BitWrite.html'>bitWrite</a>()
|
||||
</li><li><a class='wikilink' href='BitSet.html'>bitSet</a>()
|
||||
</li><li><a class='wikilink' href='BitClear.html'>bitClear</a>()
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
87
arduino-0018-linux/reference/BitClear.html
Normal file
87
arduino-0018-linux/reference/BitClear.html
Normal file
|
@ -0,0 +1,87 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - BitClear </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>bitClear()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Clears (writes a 0 to) a bit of a numeric variable.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>bitClear(x, n)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>x: the numeric variable whose bit to clear
|
||||
</p>
|
||||
<p class='vspace'></p><p>n: which bit to clear, starting at 0 for the least-significant (rightmost) bit
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>none
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='Bit.html'>bit</a>()
|
||||
</li><li><a class='wikilink' href='BitRead.html'>bitRead</a>()
|
||||
</li><li><a class='wikilink' href='BitWrite.html'>bitWrite</a>()
|
||||
</li><li><a class='wikilink' href='BitSet.html'>bitSet</a>()
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
87
arduino-0018-linux/reference/BitRead.html
Normal file
87
arduino-0018-linux/reference/BitRead.html
Normal file
|
@ -0,0 +1,87 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - BitRead </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>bitRead()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Reads a bit of a number.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>bitRead(x, n)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>x: the number from which to read
|
||||
</p>
|
||||
<p class='vspace'></p><p>n: which bit to read, starting at 0 for the least-significant (rightmost) bit
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>the value of the bit (0 or 1).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='Bit.html'>bit</a>()
|
||||
</li><li><a class='wikilink' href='BitWrite.html'>bitWrite</a>()
|
||||
</li><li><a class='wikilink' href='BitSet.html'>bitSet</a>()
|
||||
</li><li><a class='wikilink' href='BitClear.html'>bitClear</a>()
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
87
arduino-0018-linux/reference/BitSet.html
Normal file
87
arduino-0018-linux/reference/BitSet.html
Normal file
|
@ -0,0 +1,87 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - BitSet </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>bitSet()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Sets (writes a 1 to) a bit of a numeric variable.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>bitSet(x, n)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>x: the numeric variable whose bit to set
|
||||
</p>
|
||||
<p class='vspace'></p><p>n: which bit to set, starting at 0 for the least-significant (rightmost) bit
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>none
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='Bit.html'>bit</a>()
|
||||
</li><li><a class='wikilink' href='BitRead.html'>bitRead</a>()
|
||||
</li><li><a class='wikilink' href='BitWrite.html'>bitWrite</a>()
|
||||
</li><li><a class='wikilink' href='BitClear.html'>bitClear</a>()
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
89
arduino-0018-linux/reference/BitWrite.html
Normal file
89
arduino-0018-linux/reference/BitWrite.html
Normal file
|
@ -0,0 +1,89 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - BitWrite </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>bitWrite()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Writes a bit of a numeric variable.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>bitWrite(x, n, b)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>x: the numeric variable to which to write
|
||||
</p>
|
||||
<p class='vspace'></p><p>n: which bit of the number to write, starting at 0 for the least-significant (rightmost) bit
|
||||
</p>
|
||||
<p class='vspace'></p><p>b: the value to write to the bit (0 or 1)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>none
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='Bit.html'>bit</a>()
|
||||
</li><li><a class='wikilink' href='BitRead.html'>bitRead</a>()
|
||||
</li><li><a class='wikilink' href='BitSet.html'>bitSet</a>()
|
||||
</li><li><a class='wikilink' href='BitClear.html'>bitClear</a>()
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
119
arduino-0018-linux/reference/Bitshift.html
Normal file
119
arduino-0018-linux/reference/Bitshift.html
Normal file
|
@ -0,0 +1,119 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Bitshift </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>bitshift left (<<), bitshift right (>>)</h2>
|
||||
<h4>Description</h4>
|
||||
<p>From <em>The Bitmath Tutorial</em> in The Playground
|
||||
</p>
|
||||
<p class='vspace'></p><p>There are two bit shift operators in C++: the left shift operator << and the right shift operator >>. These operators cause the bits in the left operand to be shifted left or right by the number of positions specified by the right operand.<br /><br />More on bitwise math may be found <a class='urllink' href='http://www.arduino.cc/playground/Code/BitMath' rel='nofollow'>here.</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>variable << number_of_bits
|
||||
</p>
|
||||
<p class='vspace'></p><p>variable >> number_of_bits
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>variable - (byte, int, long)
|
||||
number_of_bits integer <= 32
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example:</h4>
|
||||
<pre> int a = 5; // binary: 0000000000000101
|
||||
int b = a << 3; // binary: 0000000000101000, or 40 in decimal
|
||||
int c = b >> 3; // binary: 0000000000000101, or back to 5 like we started with
|
||||
</pre>
|
||||
<p class='vspace'></p><p>When you shift a value x by y bits (x << y), the leftmost y bits in x are lost, literally shifted out of existence:
|
||||
</p>
|
||||
<p class='vspace'></p><pre> int a = 5; // binary: 0000000000000101
|
||||
int b = a << 14; // binary: 0100000000000000 - the first 1 in 101 was discarded
|
||||
</pre>
|
||||
<p class='vspace'></p><p>If you are certain that none of the ones in a value are being shifted into oblivion, a simple way to think of the left-shift operator is that it multiplies the left operand by 2 raised to the right operand power. For example, to generate powers of 2, the following expressions can be employed:
|
||||
</p>
|
||||
<p class='vspace'></p><pre> 1 << 0 == 1
|
||||
1 << 1 == 2
|
||||
1 << 2 == 4
|
||||
1 << 3 == 8
|
||||
...
|
||||
1 << 8 == 256
|
||||
1 << 9 == 512
|
||||
1 << 10 == 1024
|
||||
...
|
||||
</pre>
|
||||
<p class='vspace'></p><p>When you shift x right by y bits (x >> y), and the highest bit in x is a 1, the behavior depends on the exact data type of x. If x is of type int, the highest bit is the sign bit, determining whether x is negative or not, as we have discussed above. In that case, the sign bit is copied into lower bits, for esoteric historical reasons:
|
||||
</p>
|
||||
<p class='vspace'></p><pre> int x = -16; // binary: 1111111111110000
|
||||
int y = x >> 3; // binary: 1111111111111110
|
||||
</pre>
|
||||
<p class='vspace'></p><p>This behavior, called sign extension, is often not the behavior you want. Instead, you may wish zeros to be shifted in from the left. It turns out that the right shift rules are different for unsigned int expressions, so you can use a typecast to suppress ones being copied from the left:
|
||||
</p>
|
||||
<p class='vspace'></p><pre> int x = -16; // binary: 1111111111110000
|
||||
int y = (unsigned int)x >> 3; // binary: 0001111111111110
|
||||
</pre>
|
||||
<p class='vspace'></p><p>If you are careful to avoid sign extension, you can use the right-shift operator >> as a way to divide by powers of 2. For example:
|
||||
</p>
|
||||
<p class='vspace'></p><pre> int x = 1000;
|
||||
int y = x >> 3; // integer division of 1000 by 8, causing y = 125.
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
169
arduino-0018-linux/reference/BitwiseAnd.html
Normal file
169
arduino-0018-linux/reference/BitwiseAnd.html
Normal file
|
@ -0,0 +1,169 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - BitwiseAnd </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Bitwise AND (&), Bitwise OR (|), Bitwise XOR (^)</h2>
|
||||
<h4>Bitwise AND (&)</h4>
|
||||
<p>The bitwise operators perform their calculations at the bit level of variables. They help solve a wide range of common programming problems. Much of the material below is from an excellent tutorial on bitwise math wihch may be found <a class='urllink' href='http://www.arduino.cc/playground/Code/BitMath' rel='nofollow'>here.</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Description and Syntax</h4>
|
||||
<p>Below are descriptions and syntax for all of the operators. Further details may be found in the referenced tutorial.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Bitwise AND (&)</h4>
|
||||
<p>The bitwise AND operator in C++ is a single ampersand, &, used between two other integer expressions. Bitwise AND operates on each bit position of the surrounding expressions independently, according to this rule: if both input bits are 1, the resulting output is 1, otherwise the output is 0. Another way of expressing this is:
|
||||
</p>
|
||||
<p class='vspace'></p><pre> 0 0 1 1 operand1
|
||||
0 1 0 1 operand2
|
||||
----------
|
||||
0 0 0 1 (operand1 & operand2) - returned result
|
||||
</pre>
|
||||
<p class='vspace'></p><p>In Arduino, the type int is a 16-bit value, so using & between two int expressions causes 16 simultaneous AND operations to occur. In a code fragment like:
|
||||
</p>
|
||||
<p class='vspace'></p><pre> int a = 92; // in binary: 0000000001011100
|
||||
int b = 101; // in binary: 0000000001100101
|
||||
int c = a & b; // result: 0000000001000100, or 68 in decimal.
|
||||
</pre>
|
||||
<p class='vspace'></p><p>Each of the 16 bits in a and b are processed by using the bitwise AND, and all 16 resulting bits are stored in c, resulting in the value 01000100 in binary, which is 68 in decimal.
|
||||
</p>
|
||||
<p class='vspace'></p><p>One of the most common uses of bitwise AND is to select a particular bit (or bits) from an integer value, often called masking. See below for an example
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Bitwise OR (|)</h4>
|
||||
<p>The bitwise OR operator in C++ is the vertical bar symbol, |. Like the & operator, | operates independently each bit in its two surrounding integer expressions, but what it does is different (of course). The bitwise OR of two bits is 1 if either or both of the input bits is 1, otherwise it is 0. In other words:
|
||||
</p>
|
||||
<p class='vspace'></p><pre> 0 0 1 1 operand1
|
||||
0 1 0 1 operand2
|
||||
----------
|
||||
0 1 1 1 (operand1 | operand2) - returned result
|
||||
</pre>
|
||||
<p class='vspace'></p><p>Here is an example of the bitwise OR used in a snippet of C++ code:
|
||||
</p>
|
||||
<p class='vspace'></p><pre> int a = 92; // in binary: 0000000001011100
|
||||
int b = 101; // in binary: 0000000001100101
|
||||
int c = a | b; // result: 0000000001111101, or 125 in decimal.
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Example Program</h4>
|
||||
<p>A common job for the bitwise AND and OR operators is what programmers call Read-Modify-Write on a port. On microcontrollers, a port is an 8 bit number that represents something about the condition of the pins. Writing to a port controls all of the pins at once.
|
||||
</p>
|
||||
<p class='vspace'></p><p>PORTD is a built-in constant that refers to the output states of digital pins 0,1,2,3,4,5,6,7. If there is 1 in an bit position, then that pin is HIGH. (The pins already need to be set to outputs with the pinMode() command.) So if we write <code>PORTD = B00110001;</code> we have made pins 2,3 & 7 HIGH.
|
||||
One slight hitch here is that we <em>may</em> also have changeed the state of Pins 0 & 1, which are used by the Arduino for serial communications so we may have interfered with serial communication.
|
||||
</p>
|
||||
<p class='vspace'></p><pre> Our algorithm for the program is:
|
||||
</pre><ul><li>Get PORTD and clear out only the bits corresponding to the pins we wish to control (with bitwise AND).
|
||||
</li><li>Combine the modified PORTD value with the new value for the pins under control (with biwise OR).
|
||||
</li></ul><p class='vspace'></p><pre>int i; // counter variable
|
||||
int j;
|
||||
|
||||
void setup(){
|
||||
DDRD = DDRD | B11111100; // set direction bits for pins 2 to 7, leave 0 and 1 untouched (xx | 00 == xx)
|
||||
// same as pinMode(pin, OUTPUT) for pins 2 to 7
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop(){
|
||||
for (i=0; i<64; i++){
|
||||
|
||||
PORTD = PORTD & B00000011; // clear out bits 2 - 7, leave pins 0 and 1 untouched (xx & 11 == xx)
|
||||
j = (i << 2); // shift variable up to pins 2 - 7 - to avoid pins 0 and 1
|
||||
PORTD = PORTD | j; // combine the port information with the new information for LED pins
|
||||
Serial.println(PORTD, BIN); // debug to show masking
|
||||
delay(100);
|
||||
}
|
||||
}
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Bitwise XOR (^)</h4>
|
||||
<p>There is a somewhat unusual operator in C++ called bitwise EXCLUSIVE OR, also known as bitwise XOR. (In English this is usually pronounced "eks-or".) The bitwise XOR operator is written using the caret symbol ^. This operator is very similar to the bitwise OR operator |, only it evaluates to 0 for a given bit position when both of the input bits for that position are 1:
|
||||
</p>
|
||||
<p class='vspace'></p><pre> 0 0 1 1 operand1
|
||||
0 1 0 1 operand2
|
||||
----------
|
||||
0 1 1 0 (operand1 ^ operand2) - returned result
|
||||
</pre>
|
||||
<p class='vspace'></p><p>Another way to look at bitwise XOR is that each bit in the result is a 1 if the input bits are different, or 0 if they are the same.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Here is a simple code example:
|
||||
</p>
|
||||
<p class='vspace'></p><pre> int x = 12; // binary: 1100
|
||||
int y = 10; // binary: 1010
|
||||
int z = x ^ y; // binary: 0110, or decimal 6
|
||||
</pre>
|
||||
<p class='vspace'></p><p>The ^ operator is often used to toggle (i.e. change from 0 to 1, or 1 to 0) some of the bits in an integer expression. In a bitwise OR operation if there is a 1 in the mask bit, that bit is inverted; if there is a 0, the bit is not inverted and stays the same. Below is a program to blink digital pin 5.
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
// Blink_Pin_5
|
||||
// demo for Exclusive OR
|
||||
void setup(){
|
||||
DDRD = DDRD | B00100000; // set digital pin five as OUTPUT
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop(){
|
||||
PORTD = PORTD ^ B00100000; // invert bit 5 (digital pin 5), leave others untouched
|
||||
delay(100);
|
||||
}
|
||||
</pre>
|
||||
<p class='vspace'></p><p>See Also
|
||||
</p><ul><li><a class='wikilink' href='Boolean.html'>&&</a>(Boolean AND)
|
||||
</li><li><a class='wikilink' href='Boolean.html'>||</a>(Boolean OR)
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
185
arduino-0018-linux/reference/BitwiseCompound.html
Normal file
185
arduino-0018-linux/reference/BitwiseCompound.html
Normal file
|
@ -0,0 +1,185 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - BitwiseCompound </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>compound bitwise AND (&=), compound bitwise OR (|=)</h2>
|
||||
<p>The compound bitwise operators perform their calculations at the bit level of variables. They are often used to clear and set specific bits of a variable.
|
||||
</p>
|
||||
<p class='vspace'></p><p>See the <a class='wikilink' href='BitwiseAnd.html'>bitwise AND (&)</a> and <a class='wikilink' href='BitwiseAnd.html'>bitwise OR (|)</a> operators for the details of their operation, and also the <a class='urllink' href='http://www.arduino.cc/playground/Code/BitMath' rel='nofollow'>Bitmath Tutorial</a> for more information on bitwise operators.
|
||||
</p>
|
||||
<p class='vspace'></p><h2>compound bitwise AND (&=)</h2>
|
||||
<h4>Description </h4>
|
||||
<p>The compound bitwise AND operator (&=) is often used with a variable and a constant to force particular bits in a variable to the LOW state (to 0). This is often referred to in programming guides as "clearing" or "resetting" bits.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax:</h4>
|
||||
<pre>
|
||||
x &= y; // equivalent to x = x & y;
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>x: a char, int or long variable<br />y: an integer constant or char, int, or long
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example:</h4>
|
||||
<p>First, a review of the Bitwise AND (&) operator
|
||||
</p><pre>
|
||||
0 0 1 1 operand1
|
||||
0 1 0 1 operand2
|
||||
----------
|
||||
0 0 0 1 (operand1 & operand2) - returned result
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p>Bits that are "bitwise <span class='wikiword'>ANDed</span>" with 0 are cleared to 0 so, if myByte is a byte variable,<br />
|
||||
<code>myByte & B00000000 = 0;</code>
|
||||
</p>
|
||||
<p class='vspace'></p><p>Bits that are "bitwise <span class='wikiword'>ANDed</span>" with 1 are unchanged so, <br />
|
||||
<code>myByte & B11111111 = myByte;</code>
|
||||
</p>
|
||||
<p class='vspace'></p><p>Note: because we are dealing with bits in a bitwise operator - it is convenient to use the binary formatter with <a class='wikilink' href='IntegerConstants.html'>constants.</a> The numbers are still the same value in other representations, they are just not as easy to understand. Also, B00000000 is shown for clarity, but zero in any number format is zero (hmmm something philosophical there?)
|
||||
</p>
|
||||
<p class='vspace'></p><p>Consequently - to clear (set to zero) bits 0 & 1 of a variable, while leaving the rest of the variable unchanged, use the compound bitwise AND operator (&=) with the constant B11111100
|
||||
</p><pre>
|
||||
1 0 1 0 1 0 1 0 variable
|
||||
1 1 1 1 1 1 0 0 mask
|
||||
----------------------
|
||||
1 0 1 0 1 0 0 0
|
||||
|
||||
variable unchanged
|
||||
bits cleared
|
||||
|
||||
</pre><p>Here is the same representation with the variable's bits replaced with the symbol x
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
x x x x x x x x variable
|
||||
1 1 1 1 1 1 0 0 mask
|
||||
----------------------
|
||||
x x x x x x 0 0
|
||||
|
||||
variable unchanged
|
||||
bits cleared
|
||||
|
||||
</pre><p>So if:
|
||||
</p><pre>
|
||||
myByte = 10101010;
|
||||
|
||||
myByte &= B1111100 == B10101000;
|
||||
</pre>
|
||||
<p class='vspace'></p><h2>compound bitwise OR (|=)</h2>
|
||||
<h4>Description </h4>
|
||||
<p>The compound bitwise OR operator (|=) is often used with a variable and a constant to "set" (set to 1) particular bits in a variable.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax:</h4>
|
||||
<pre>
|
||||
x |= y; // equivalent to x = x | y;
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>x: a char, int or long variable<br />y: an integer constant or char, int, or long
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example:</h4>
|
||||
<p>First, a review of the Bitwise OR (|) operator
|
||||
</p><pre>
|
||||
0 0 1 1 operand1
|
||||
0 1 0 1 operand2
|
||||
----------
|
||||
0 1 1 1 (operand1 | operand2) - returned result
|
||||
|
||||
</pre><p>Bits that are "bitwise <span class='wikiword'>ORed</span>" with 0 are unchanged, so if myByte is a byte variable,<br />
|
||||
myByte | B00000000 = myByte;
|
||||
</p>
|
||||
<p class='vspace'></p><p>Bits that are "bitwise <span class='wikiword'>ORed</span>" with 1 are set to 1 so:<br />myByte & B11111111 = B11111111;
|
||||
</p>
|
||||
<p class='vspace'></p><p>Consequently - to set bits 0 & 1 of a variable, while leaving the rest of the variable unchanged, use the compound bitwise AND operator (&=) with the constant B00000011
|
||||
</p><pre>
|
||||
1 0 1 0 1 0 1 0 variable
|
||||
0 0 0 0 0 0 1 1 mask
|
||||
----------------------
|
||||
1 0 1 0 1 0 1 1
|
||||
|
||||
variable unchanged
|
||||
bits set
|
||||
|
||||
|
||||
</pre><p>Here is the same representation with the variables bits replaced with the symbol x
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
x x x x x x x x variable
|
||||
0 0 0 0 0 0 1 1 mask
|
||||
----------------------
|
||||
x x x x x x 1 1
|
||||
|
||||
variable unchanged
|
||||
bits set
|
||||
|
||||
</pre><p>So if:
|
||||
</p><pre>
|
||||
myByte = B10101010;
|
||||
|
||||
myByte |= B00000011 == B10101011;
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p>See Also
|
||||
</p><ul><li><a class='wikilink' href='BitwiseAnd.html'>&</a> (bitwise AND)
|
||||
</li><li><a class='wikilink' href='BitwiseAnd.html'>|</a> (bitwise OR)
|
||||
</li><li><a class='wikilink' href='Boolean.html'>&&</a> (Boolean AND)
|
||||
</li><li><a class='wikilink' href='Boolean.html'>||</a> (Boolean OR)
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
84
arduino-0018-linux/reference/BitwiseXorNot.html
Normal file
84
arduino-0018-linux/reference/BitwiseXorNot.html
Normal file
|
@ -0,0 +1,84 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - BitwiseXorNot </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Bitwise NOT (~)</h2>
|
||||
<p>The bitwise NOT operator in C++ is the tilde character ~. Unlike & and |, the bitwise NOT operator is applied to a single operand to its right. Bitwise NOT changes each bit to its opposite: 0 becomes 1, and 1 becomes 0. For example:
|
||||
</p>
|
||||
<p class='vspace'></p><pre> 0 1 operand1
|
||||
</pre>
|
||||
<p class='vspace'></p><pre> ----------
|
||||
1 0 ~ operand1
|
||||
</pre>
|
||||
<p class='vspace'></p><pre> int a = 103; // binary: 0000000001100111
|
||||
int b = ~a; // binary: 1111111110011000 = -104
|
||||
</pre>
|
||||
<p class='vspace'></p><p>You might be surprised to see a negative number like -104 as the result of this operation. This is because the highest bit in an int variable is the so-called sign bit. If the highest bit is 1, the number is interpreted as negative. This encoding of positive and negative numbers is referred to as two's complement. For more information, see the Wikipedia article on <a class='urllink' href='http://en.wikipedia.org/wiki/Twos_complement' rel='nofollow'>two's complement.</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p>As an aside, it is interesting to note that for any integer x, ~x is the same as -x-1.
|
||||
</p>
|
||||
<p class='vspace'></p><p>At times, the sign bit in a signed integer expression can cause some unwanted surprises.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
132
arduino-0018-linux/reference/Board.html
Normal file
132
arduino-0018-linux/reference/Board.html
Normal file
|
@ -0,0 +1,132 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Board </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://www.arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://www.arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://www.arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://www.arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='selflink' href='Board.html'>Board</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Introduction to the Arduino Board</h2>
|
||||
<p>Looking at the board from the top down, this is an outline of what you will see (parts of the board you might interact with in the course of normal use are highlighted):
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://www.arduino.cc/en/uploads/Reference/arduino_board.png' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p>Starting clockwise from the top center:
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li>Analog Reference pin (orange)
|
||||
</li><li>Digital Ground (light green)
|
||||
</li><li>Digital Pins 2-13 (green)
|
||||
</li><li>Digital Pins 0-1/Serial In/Out - TX/RX (dark green) - <em>These pins cannot be used for digital i/o (<strong>digitalRead</strong> and <strong>digitalWrite</strong>) if you are also using serial communication (e.g. <strong>Serial.begin</strong>)</em>.
|
||||
</li><li>Reset Button - S1 (dark blue)
|
||||
</li><li>In-circuit Serial Programmer (blue-green)
|
||||
</li><li>Analog In Pins 0-5 (light blue)
|
||||
</li><li>Power and Ground Pins (power: orange, grounds: light orange)
|
||||
</li><li>External Power Supply In (9-12VDC) - X1 (pink)
|
||||
</li><li>Toggles External Power and USB Power (place jumper on two pins closest to desired supply) - <span class='wikiword'>SV1</span> (purple)
|
||||
</li><li>USB (used for uploading sketches to the board and for serial communication between the board and the computer; can be used to power the board) (yellow)
|
||||
</li></ul><p class='vspace'></p><h3>Microcontrollers</h3>
|
||||
<table width='100%' border='0' cellpadding='5' cellspacing='0'><tr><td width='50%' valign='top'>
|
||||
<p class='vspace'></p><p><em><span class='wikiword'>ATmega168</span></em> (used on most Arduino boards)
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
<table border='0'><tr ><td align='left'>Digital I/O Pins</td><td align='left'>14 (of which 6 provide PWM output)</td></tr>
|
||||
<tr ><td align='left'>Analog Input Pins</td><td align='left'>6 (DIP) or 8 (SMD)</td></tr>
|
||||
<tr ><td align='left'>DC Current per I/O Pin</td><td align='left'>40 mA</td></tr>
|
||||
<tr ><td align='left'>Flash Memory</td><td align='left'>16 KB</td></tr>
|
||||
<tr ><td align='left'>SRAM</td><td align='left'>1 KB</td></tr>
|
||||
<tr ><td align='left'>EEPROM</td><td align='left'>512 bytes</td></tr>
|
||||
</table>
|
||||
<p class='vspace'></p><p>(<a class='urllink' href='http://www.atmel.com/dyn/resources/prod_documents/doc2545.pdf' rel='nofollow'>datasheet</a>)
|
||||
</p>
|
||||
<p class='vspace'></p></td><td width='50%' valign='top'>
|
||||
<p class='vspace'></p><p><em><span class='wikiword'>ATmega8</span></em> (used on some older board)
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
<table border='0'><tr ><td align='left'>Digital I/O Pins</td><td align='left'>14 (of which 3 provide PWM output)</td></tr>
|
||||
<tr ><td align='left'>Analog Input Pins</td><td align='left'>6</td></tr>
|
||||
<tr ><td align='left'>DC Current per I/O Pin</td><td align='left'>40 mA</td></tr>
|
||||
<tr ><td align='left'>Flash Memory</td><td align='left'>8 KB</td></tr>
|
||||
<tr ><td align='left'>SRAM</td><td align='left'>1 KB</td></tr>
|
||||
<tr ><td align='left'>EEPROM</td><td align='left'>512 bytes</td></tr>
|
||||
</table>
|
||||
<p class='vspace'></p><p>(<a class='urllink' href='http://www.atmel.com/dyn/resources/prod_documents/doc2486.pdf' rel='nofollow'>datasheet</a>)
|
||||
</p>
|
||||
<p class='vspace'></p></td></tr></table>
|
||||
<p class='vspace'></p><h3>Digital Pins</h3>
|
||||
<p>In addition to the specific functions listed below, the digital pins on an Arduino board can be used for general purpose input and output via the <a class='wikilink' href='PinMode.html'>pinMode()</a>, <a class='wikilink' href='DigitalRead.html'>digitalRead()</a>, and <a class='wikilink' href='DigitalWrite.html'>digitalWrite()</a> commands. Each pin has an internal pull-up resistor which can be turned on and off using digitalWrite() (w/ a value of HIGH or LOW, respectively) when the pin is configured as an input. The maximum current per pin is 40 mA.
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><strong>Serial: 0 (RX) and 1 (TX).</strong> Used to receive (RX) and transmit (TX) TTL serial data. On the Arduino Diecimila, these pins are connected to the corresponding pins of the FTDI USB-to-TTL Serial chip. On the Arduino BT, they are connected to the corresponding pins of the <span class='wikiword'>WT11</span> Bluetooth module. On the Arduino Mini and <span class='wikiword'>LilyPad</span> Arduino, they are intended for use with an external TTL serial module (e.g. the Mini-USB Adapter).
|
||||
<p class='vspace'></p></li><li><strong>External Interrupts: 2 and 3.</strong> These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the <a class='wikilink' href='AttachInterrupt.html'>attachInterrupt()</a> function for details.
|
||||
<p class='vspace'></p></li><li><strong>PWM: 3, 5, 6, 9, 10, and 11.</strong> Provide 8-bit PWM output with the <a class='wikilink' href='AnalogWrite.html'>analogWrite()</a> function. On boards with an <span class='wikiword'>ATmega8</span>, PWM output is available only on pins 9, 10, and 11.
|
||||
<p class='vspace'></p></li><li><strong>BT Reset: 7.</strong> (Arduino BT-only) Connected to the reset line of the bluetooth module.
|
||||
<p class='vspace'></p></li><li><strong>SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK).</strong> These pins support SPI communication, which, although provided by the underlying hardware, is not currently included in the Arduino language.
|
||||
<p class='vspace'></p></li><li><strong>LED: 13.</strong> On the Diecimila and <span class='wikiword'>LilyPad</span>, there is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it's off.
|
||||
</li></ul><p class='vspace'></p><h3>Analog Pins</h3>
|
||||
<p>In addition to the specific functions listed below, the analog input pins support 10-bit analog-to-digital conversion (ADC) using the <a class='wikilink' href='AnalogRead.html'>analogRead()</a> function. Most of the analog inputs can also be used as digital pins: analog input 0 as digital pin 14 through analog input 5 as digital pin 19. Analog inputs 6 and 7 (present on the Mini and BT) cannot be used as digital pins.
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><strong>I<sup>2</sup>C: 4 (SDA) and 5 (SCL).</strong> Support I<sup>2</sup>C (TWI) communication using the <a class='urllink' href='http://wiring.org.co/reference/libraries/Wire/index.html' rel='nofollow'>Wire library</a> (documentation on the Wiring website).
|
||||
</li></ul><p class='vspace'></p><h3>Power Pins</h3>
|
||||
<ul><li><strong>VIN</strong> (sometimes labelled "9V"). The input voltage to the Arduino board when it's using an external power source (as opposed to 5 volts from the USB connection or other regulated power source). You can supply voltage through this pin, or, if supplying voltage via the power jack, access it through this pin. Note that different boards accept different input voltages ranges, please see the <a class='urllink' href='http://www.arduino.cc/en/Main/Hardware' rel='nofollow'>documentation for your board</a>. Also note that the <span class='wikiword'>LilyPad</span> has no VIN pin and accepts only a regulated input.
|
||||
<p class='vspace'></p></li><li><strong>5V.</strong> The regulated power supply used to power the microcontroller and other components on the board. This can come either from VIN via an on-board regulator, or be supplied by USB or another regulated 5V supply.
|
||||
<p class='vspace'></p></li><li><strong>3V3.</strong> (Diecimila-only) A 3.3 volt supply generated by the on-board FTDI chip.
|
||||
<p class='vspace'></p></li><li><strong>GND.</strong> Ground pins.
|
||||
</li></ul><p class='vspace'></p><h3>Other Pins</h3>
|
||||
<ul><li><strong>AREF.</strong> Reference voltage for the analog inputs. Used with <a class='wikilink' href='AnalogReference.html'>analogReference</a>().
|
||||
<p class='vspace'></p></li><li><strong>Reset.</strong> (Diecimila-only) Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board.
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://www.arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
111
arduino-0018-linux/reference/Boolean.html
Normal file
111
arduino-0018-linux/reference/Boolean.html
Normal file
|
@ -0,0 +1,111 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Boolean </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h1>Boolean Operators </h1>
|
||||
<p>These can be used inside the condition of an <a class='wikilink' href='If.html'>if</a> statement.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>&& (logical and)</h3>
|
||||
<p>True only if both operands are true, e.g.
|
||||
</p><pre>
|
||||
if (digitalRead(2) == HIGH && digitalRead(3) == HIGH) { // read two switches
|
||||
// ...
|
||||
}
|
||||
</pre><p>is true only if both inputs are high.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>|| (logical or)</h3>
|
||||
<p>True if either operand is true, e.g.
|
||||
</p><pre>
|
||||
if (x > 0 || y > 0) {
|
||||
// ...
|
||||
}
|
||||
</pre><p>is true if either x or y is greater than 0.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>! (not)</h3>
|
||||
<p>True if the operand is false, e.g.
|
||||
</p><pre>
|
||||
if (!x) {
|
||||
// ...
|
||||
}
|
||||
</pre><p>is true if x is false (i.e. if x equals 0).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Warning</h4>
|
||||
<p>Make sure you don't mistake the boolean AND operator, && (double ampersand) for the bitwise AND operator & (single ampersand). They are entirely different beasts.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Similarly, do not confuse the boolean || (double pipe) operator with the bitwise OR operator | (single pipe).
|
||||
</p>
|
||||
<p class='vspace'></p><p>The bitwise not ~ (tilde) looks much different than the boolean not ! (exclamation point or "bang" as the programmers say) but you still have to be sure which one you want where.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Examples</h4>
|
||||
<pre>
|
||||
if (a >= 10 && a <= 20){} // true if a is between 10 and 20
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='BitwiseAnd.html'>&</a> (bitwise AND)
|
||||
</li><li><a class='wikilink' href='BitwiseAnd.html'>|</a> (bitwise OR)
|
||||
</li><li><a class='wikilink' href='BitwiseXorNot.html'>~</a> (bitwise NOT
|
||||
</li><li><a class='wikilink' href='If.html'>if</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
102
arduino-0018-linux/reference/BooleanVariables.html
Normal file
102
arduino-0018-linux/reference/BooleanVariables.html
Normal file
|
@ -0,0 +1,102 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - BooleanVariables </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>boolean</h2>
|
||||
<p>A <strong>boolean</strong> holds one of two values, <a class='wikilink' href='Constants.html'>true</a> or <a class='wikilink' href='Constants.html'>false</a>. (Each boolean variable occupies one byte of memory.)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
int LEDpin = 5; // LED on pin 5
|
||||
int switchPin = 13; // momentary switch on 13, other side connected to ground
|
||||
|
||||
boolean running = false;
|
||||
|
||||
void setup()
|
||||
{
|
||||
pinMode(LEDpin, OUTPUT);
|
||||
pinMode(switchPin, INPUT);
|
||||
digitalWrite(switchPin, HIGH); // turn on pullup resistor
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (digitalRead(switchPin) == LOW)
|
||||
{ // switch is pressed - pullup keeps pin high normally
|
||||
delay(100); // delay to debounce switch
|
||||
running = !running; // toggle running variable
|
||||
digitalWrite(LEDpin, running) // indicate via LED
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='Constants.html'>constants</a>
|
||||
</li><li><a class='wikilink' href='Boolean.html'>boolean operators</a>
|
||||
</li><li><a class='urllink' href='VariableDeclaration.html' rel='nofollow'>Variable Declaration</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
119
arduino-0018-linux/reference/Braces.html
Normal file
119
arduino-0018-linux/reference/Braces.html
Normal file
|
@ -0,0 +1,119 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Braces </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>{} Curly Braces</h2>
|
||||
<p>Curly braces (also referred to as just "braces" or as "curly brackets") are a major part of the C programming language. They are used in several different constructs, outlined below, and this can sometimes be confusing for beginners.
|
||||
</p>
|
||||
<p class='vspace'></p><p>An opening curly brace "{" must always be followed by a closing curly brace "}". This is a condition that is often referred to as the braces being balanced. The Arduino IDE (integrated development environment) includes a convenient feature to check the balance of curly braces. Just select a brace, or even click the insertion point immediately following a brace, and its logical companion will be highlighted.
|
||||
</p>
|
||||
<p class='vspace'></p><p>At present this feature is slightly buggy as the IDE will often find (incorrectly) a brace in text that has been "commented out."
|
||||
</p>
|
||||
<p class='vspace'></p><p>Beginning programmers, and programmers coming to C from the BASIC language often find using braces confusing or daunting. After all, the same curly braces replace the RETURN statement in a subroutine (function), the ENDIF statement in a conditional and the NEXT statement in a FOR loop.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Because the use of the curly brace is so varied, it is good programming practice to type the closing brace immediately after typing the opening brace when inserting a construct which requires curly braces. Then insert some carriage returns between your braces and begin inserting statements. Your braces, and your attitude, will never become unbalanced.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Unbalanced braces can often lead to cryptic, impenetrable compiler errors that can sometimes be hard to track down in a large program. Because of their varied usages, braces are also incredibly important to the syntax of a program and moving a brace one or two lines will often dramatically affect the meaning of a program.
|
||||
</p>
|
||||
<p class='vspace'></p><h4><strong>The main uses of curly braces</strong></h4>
|
||||
<h4>Functions</h4>
|
||||
<pre> void myfunction(datatype argument){
|
||||
statements(s)
|
||||
}
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Loops</h4>
|
||||
<pre> while (boolean expression)
|
||||
{
|
||||
statement(s)
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
statement(s)
|
||||
} while (boolean expression);
|
||||
|
||||
for (initialisation; termination condition; incrementing expr)
|
||||
{
|
||||
statement(s)
|
||||
}
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Conditional statements</h4>
|
||||
<p class='vspace'></p><pre> if (boolean expression)
|
||||
{
|
||||
statement(s)
|
||||
}
|
||||
|
||||
else if (boolean expression)
|
||||
{
|
||||
statement(s)
|
||||
}
|
||||
else
|
||||
{
|
||||
statement(s)
|
||||
}
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
85
arduino-0018-linux/reference/Break.html
Normal file
85
arduino-0018-linux/reference/Break.html
Normal file
|
@ -0,0 +1,85 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Break </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>break</h2>
|
||||
<p><strong>break</strong> is used to exit from a <strong>do</strong>, <strong>for</strong>, or <strong>while</strong> loop, bypassing the normal loop condition. It is also used to exit from a <strong>switch</strong> statement.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
for (x = 0; x < 255; x ++)
|
||||
{
|
||||
digitalWrite(PWMpin, x);
|
||||
sens = analogRead(sensorPin);
|
||||
if (sens > threshold){ // bail out on sensor detect
|
||||
x = 0;
|
||||
break;
|
||||
}
|
||||
delay(50);
|
||||
}
|
||||
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
78
arduino-0018-linux/reference/Byte.html
Normal file
78
arduino-0018-linux/reference/Byte.html
Normal file
|
@ -0,0 +1,78 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Byte </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>byte</h2>
|
||||
<h4>Description</h4>
|
||||
<p>A byte stores an 8-bit unsigned number, from 0 to 255.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre> byte b = B10010; // "B" is the binary formatter (B10010 = 18 decimal)
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='Word.html'>word</a>
|
||||
</li><li><a class='wikilink' href='ByteCast.html'>byte</a>()
|
||||
</li><li><a class='urllink' href='VariableDeclaration.html' rel='nofollow'>Variable Declaration</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
82
arduino-0018-linux/reference/ByteCast.html
Normal file
82
arduino-0018-linux/reference/ByteCast.html
Normal file
|
@ -0,0 +1,82 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ByteCast </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>byte()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Converts a value to the <a class='wikilink' href='Byte.html'>byte</a> data type.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>byte(x)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>x: a value of any type
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>byte
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='Byte.html'>byte</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
90
arduino-0018-linux/reference/Cast.html
Normal file
90
arduino-0018-linux/reference/Cast.html
Normal file
|
@ -0,0 +1,90 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Cast </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://www.arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://www.arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://www.arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://www.arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Board.html'>Board</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Cast</h2>
|
||||
<h4>Description</h4>
|
||||
<p>The cast operator translates one variable type into another and forces calculations to be performed in the cast type.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>(type)variable
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters:</h4>
|
||||
<p>type: any variable type (e.g. int, float, byte)
|
||||
</p>
|
||||
<p class='vspace'></p><p>variable: any variable or constant
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
int i;
|
||||
float f;
|
||||
|
||||
f = 3.6;
|
||||
i = (int) f; // now i is 3
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Note</h4>
|
||||
<p>When casting from a float to an int, the value is truncated not rounded. So both <code>(int) 3.2</code> and <code>(int) 3.7</code> are 3.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://www.arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
89
arduino-0018-linux/reference/Changes.html
Normal file
89
arduino-0018-linux/reference/Changes.html
Normal file
|
@ -0,0 +1,89 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Changes </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='selflink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Changes</h2>
|
||||
<p>This page lists major changes to the Arduino core, libraries, and environment. For details, see the <a class='wikilink' href='http://arduino.cc/en/Main/ReleaseNotes'>release notes</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Changes in Arduino 0017</h3>
|
||||
<ul><li><strong>Environment</strong>: The code base for the Arduino development environment was largely re-written to bring it back into sync with Processing (1.0.3). The main differences include support for multiple sketch windows open simultaneously and a dedicated window for the serial monitor.
|
||||
<p class='vspace'></p></li><li><strong>Icons</strong>: The icons and about images were updated.
|
||||
<p class='vspace'></p></li><li><strong>Arduino.app</strong>: The Mac OS X version of Arduino is now a .app file packaged in a .dmg.
|
||||
<p class='vspace'></p></li><li><strong>Libraries</strong>: Support was added for third-party libraries in the <em>SKETCHBOOK</em>/libraries directory. This allows user-installed libraries to persist across upgrades of the Arduino software.
|
||||
<p class='vspace'></p></li><li><strong>Servo</strong>: The servo library was rewritten to allow support for up to 12 servos (on any pins) and up to 48 on the Mega.
|
||||
<p class='vspace'></p></li><li><strong><span class='wikiword'>LiquidCrystal</span></strong>: The begin(), cursor(), noCursor(), blink(), noBlink(), display(), noDisplay(), scrollDisplayLeft(), scrollDisplayRight(), autoscroll(), noAutoscroll(), leftToRight(), rightToLeft(), and createChar() functions were added.
|
||||
</li></ul><p class='vspace'></p><h3>Changes in Arduino 0016</h3>
|
||||
<ul><li>New functions for writing a string, write(str), or buffer, write(buf, len), were added to the Print, Serial, and Ethernet library Client and Server classes.
|
||||
</li></ul><p class='vspace'></p><h3>Changes in Arduino 0015</h3>
|
||||
<ul><li>Support for the Arduino Mega.
|
||||
</li></ul><p class='vspace'></p><h3>Changes in Arduino 0013</h3>
|
||||
<ul><li>Support for printing floats was added to the Print, Serial, and Ethernet library Client and Server classes.
|
||||
<p class='vspace'></p></li><li>The word type and word(), bitRead(), bitWrite(), bitSet(), bitClear(), bit(), lowByte(), and highByte() functions were added.
|
||||
</li></ul><p class='vspace'></p><h3>Changes in Arduino 0012</h3>
|
||||
<ul><li>Added the Firmata library, which provides a standard protocol for serial communication.
|
||||
<p class='vspace'></p></li><li>Added Ethernet library.
|
||||
<p class='vspace'></p></li><li>Added Servo library.
|
||||
<p class='vspace'></p></li><li>Added <span class='wikiword'>LiquidCrystal</span> library.
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
85
arduino-0018-linux/reference/Char.html
Normal file
85
arduino-0018-linux/reference/Char.html
Normal file
|
@ -0,0 +1,85 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Char </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>char</h2>
|
||||
<h4>Description</h4>
|
||||
<p>A data type that takes up 1 byte of memory that stores a character value. Character literals are written in single quotes, like this: 'A' (for multiple characters - strings - use double quotes: "ABC").
|
||||
</p>
|
||||
<p class='vspace'></p><p>Characters are stored as numbers however. You can see the specific encoding in the <a class='wikilink' href='ASCIIchart.html'>ASCII chart</a>. This means that it is possible to do arithmetic on characters, in which the ASCII value of the character is used (e.g. 'A' + 1 has the value 66, since the ASCII value of the capital letter A is 65). See <a class='wikilink' href='Serial_Println.html'>Serial.println</a> reference for more on how characters are translated to numbers.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The char datatype is a signed type, meaning that it encodes numbers from -128 to 127. For an unsigned, one-byte (8 bit) data type, use the <em>byte</em> data type.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre> char myChar = 'A';
|
||||
char myChar = 65; // both are equivalent
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='Byte.html'>byte</a>
|
||||
</li><li><a class='wikilink' href='Int.html'>int</a>
|
||||
</li><li><a class='wikilink' href='Array.html'>array</a>
|
||||
</li><li><a class='wikilink' href='Serial_Println.html'>Serial.println</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
82
arduino-0018-linux/reference/CharCast.html
Normal file
82
arduino-0018-linux/reference/CharCast.html
Normal file
|
@ -0,0 +1,82 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - CharCast </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>char()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Converts a value to the <a class='wikilink' href='Char.html'>char</a> data type.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>char(x)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>x: a value of any type
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>char
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='Char.html'>char</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
126
arduino-0018-linux/reference/ClientAvailable.html
Normal file
126
arduino-0018-linux/reference/ClientAvailable.html
Normal file
|
@ -0,0 +1,126 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ClientAvailable </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='Ethernet.html'>Ethernet</a> : <em>Client</em> class
|
||||
</p>
|
||||
<p class='vspace'></p><h2>available()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Returns the number of bytes available for reading (that is, the amount of data that has been written to the client by the server it is connected to).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p><em>client</em>.available()
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>none
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>The number of bytes available.
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
#include <Ethernet.h>
|
||||
|
||||
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
|
||||
byte ip[] = { 10, 0, 0, 177 };
|
||||
byte server[] = { 64, 233, 187, 99 }; // Google
|
||||
|
||||
Client client(server, 80);
|
||||
|
||||
void setup()
|
||||
{
|
||||
Ethernet.begin(mac, ip);
|
||||
Serial.begin(9600);
|
||||
|
||||
delay(1000);
|
||||
|
||||
Serial.println("connecting...");
|
||||
|
||||
if (client.connect()) {
|
||||
Serial.println("connected");
|
||||
client.println("GET /search?q=arduino HTTP/1.0");
|
||||
client.println();
|
||||
} else {
|
||||
Serial.println("connection failed");
|
||||
}
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (client.available()) {
|
||||
char c = client.read();
|
||||
Serial.print(c);
|
||||
}
|
||||
|
||||
if (!client.connected()) {
|
||||
Serial.println();
|
||||
Serial.println("disconnecting.");
|
||||
client.stop();
|
||||
for(;;)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
127
arduino-0018-linux/reference/ClientConnect.html
Normal file
127
arduino-0018-linux/reference/ClientConnect.html
Normal file
|
@ -0,0 +1,127 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ClientConnect </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='Ethernet.html'>Ethernet</a> : <em>Client</em> class
|
||||
</p>
|
||||
<p class='vspace'></p><h2>connect()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Connect to the IP address and port specified in the constructor. The return value indicates success or failure.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p><em>client</em>.connect()
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>none
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>Returns true if the connection succeeds, false if not.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
#include <Ethernet.h>
|
||||
|
||||
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
|
||||
byte ip[] = { 10, 0, 0, 177 };
|
||||
byte server[] = { 64, 233, 187, 99 }; // Google
|
||||
|
||||
Client client(server, 80);
|
||||
|
||||
void setup()
|
||||
{
|
||||
Ethernet.begin(mac, ip);
|
||||
Serial.begin(9600);
|
||||
|
||||
delay(1000);
|
||||
|
||||
Serial.println("connecting...");
|
||||
|
||||
if (client.connect()) {
|
||||
Serial.println("connected");
|
||||
client.println("GET /search?q=arduino HTTP/1.0");
|
||||
client.println();
|
||||
} else {
|
||||
Serial.println("connection failed");
|
||||
}
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (client.available()) {
|
||||
char c = client.read();
|
||||
Serial.print(c);
|
||||
}
|
||||
|
||||
if (!client.connected()) {
|
||||
Serial.println();
|
||||
Serial.println("disconnecting.");
|
||||
client.stop();
|
||||
for(;;)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
127
arduino-0018-linux/reference/ClientConnected.html
Normal file
127
arduino-0018-linux/reference/ClientConnected.html
Normal file
|
@ -0,0 +1,127 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ClientConnected </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='Ethernet.html'>Ethernet</a> : <em>Client</em> class
|
||||
</p>
|
||||
<p class='vspace'></p><h2>connected()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Whether or not the client is connected. Note that a client is considered connected if the connection has been closed but there is still unread data.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p><em>client</em>.connected()
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>none
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>Returns true if the client is connected, false if not.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
#include <Ethernet.h>
|
||||
|
||||
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
|
||||
byte ip[] = { 10, 0, 0, 177 };
|
||||
byte server[] = { 64, 233, 187, 99 }; // Google
|
||||
|
||||
Client client(server, 80);
|
||||
|
||||
void setup()
|
||||
{
|
||||
Ethernet.begin(mac, ip);
|
||||
Serial.begin(9600);
|
||||
|
||||
delay(1000);
|
||||
|
||||
Serial.println("connecting...");
|
||||
|
||||
if (client.connect()) {
|
||||
Serial.println("connected");
|
||||
client.println("GET /search?q=arduino HTTP/1.0");
|
||||
client.println();
|
||||
} else {
|
||||
Serial.println("connection failed");
|
||||
}
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (client.available()) {
|
||||
char c = client.read();
|
||||
Serial.print(c);
|
||||
}
|
||||
|
||||
if (!client.connected()) {
|
||||
Serial.println();
|
||||
Serial.println("disconnecting.");
|
||||
client.stop();
|
||||
for(;;)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
126
arduino-0018-linux/reference/ClientConstructor.html
Normal file
126
arduino-0018-linux/reference/ClientConstructor.html
Normal file
|
@ -0,0 +1,126 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ClientConstructor </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='Ethernet.html'>Ethernet</a> : <em>Client</em> class
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Client()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Creates a client which can connect to the specified internet IP address and port.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>Client(ip, port)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>ip: the IP address that the client will connect to (array of 4 bytes)
|
||||
</p>
|
||||
<p class='vspace'></p><p>port: the port that the client will connect to (int)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
#include <Ethernet.h>
|
||||
|
||||
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
|
||||
byte ip[] = { 10, 0, 0, 177 };
|
||||
byte server[] = { 64, 233, 187, 99 }; // Google
|
||||
|
||||
Client client(server, 80);
|
||||
|
||||
void setup()
|
||||
{
|
||||
Ethernet.begin(mac, ip);
|
||||
Serial.begin(9600);
|
||||
|
||||
delay(1000);
|
||||
|
||||
Serial.println("connecting...");
|
||||
|
||||
if (client.connect()) {
|
||||
Serial.println("connected");
|
||||
client.println("GET /search?q=arduino HTTP/1.0");
|
||||
client.println();
|
||||
} else {
|
||||
Serial.println("connection failed");
|
||||
}
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
if (client.available()) {
|
||||
char c = client.read();
|
||||
Serial.print(c);
|
||||
}
|
||||
|
||||
if (!client.connected()) {
|
||||
Serial.println();
|
||||
Serial.println("disconnecting.");
|
||||
client.stop();
|
||||
for(;;)
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
81
arduino-0018-linux/reference/ClientFlush.html
Normal file
81
arduino-0018-linux/reference/ClientFlush.html
Normal file
|
@ -0,0 +1,81 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ClientFlush </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='Ethernet.html'>Ethernet</a> : <em>Client</em> class
|
||||
</p>
|
||||
<p class='vspace'></p><h2>flush()</h2>
|
||||
<p>Discard any bytes that have been written to the client but not yet read.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p><em>client</em>.flush()
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>none
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>none
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
85
arduino-0018-linux/reference/ClientPrint.html
Normal file
85
arduino-0018-linux/reference/ClientPrint.html
Normal file
|
@ -0,0 +1,85 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ClientPrint </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='Ethernet.html'>Ethernet</a> : <em>Client</em> class
|
||||
</p>
|
||||
<p class='vspace'></p><h2>print()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Print data to the server that a client is connected to. Prints numbers as a sequence of digits, each an ASCII character (e.g. the number 123 is sent as the three characters '1', '2', '3').
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p><em>client</em>.print(data) <br /><em>client</em>.print(data, BASE)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>data: the data to print (char, byte, int, long, or string)
|
||||
</p>
|
||||
<p class='vspace'></p><p>BASE (optional): the base in which to print numbers: BIN for binary (base 2), DEC for decimal (base 10), OCT for octal (base 8), HEX for hexadecimal (base 16).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
85
arduino-0018-linux/reference/ClientPrintln.html
Normal file
85
arduino-0018-linux/reference/ClientPrintln.html
Normal file
|
@ -0,0 +1,85 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ClientPrintln </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='Ethernet.html'>Ethernet</a> : <em>Client</em> class
|
||||
</p>
|
||||
<p class='vspace'></p><h2>println()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Print data, followed by a newline, to the server a client is connected to. Prints numbers as a sequence of digits, each an ASCII character (e.g. the number 123 is sent as the three characters '1', '2', '3').
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p><em>client</em>.println() <br /><em>client</em>.println(data) <br /><em>client</em>.print(data, BASE)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>data (optional): the data to print (char, byte, int, long, or string)
|
||||
</p>
|
||||
<p class='vspace'></p><p>BASE (optional): the base in which to print numbers: BIN for binary (base 2), DEC for decimal (base 10), OCT for octal (base 8), HEX for hexadecimal (base 16).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
81
arduino-0018-linux/reference/ClientRead.html
Normal file
81
arduino-0018-linux/reference/ClientRead.html
Normal file
|
@ -0,0 +1,81 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ClientRead </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='Ethernet.html'>Ethernet</a> : <em>Client</em> class
|
||||
</p>
|
||||
<p class='vspace'></p><h2>read()</h2>
|
||||
<p>Read the next byte received from the server the client is connected to (after the last call to read()).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p><em>client</em>.read()
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>none
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>The next byte (or character), or -1 if none is available.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
82
arduino-0018-linux/reference/ClientStop.html
Normal file
82
arduino-0018-linux/reference/ClientStop.html
Normal file
|
@ -0,0 +1,82 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ClientStop </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='Ethernet.html'>Ethernet</a> : <em>Client</em> class
|
||||
</p>
|
||||
<p class='vspace'></p><h2>stop()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Disconnect from the server.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p><em>client</em>.stop()
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>none
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>none
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
80
arduino-0018-linux/reference/ClientWrite.html
Normal file
80
arduino-0018-linux/reference/ClientWrite.html
Normal file
|
@ -0,0 +1,80 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ClientWrite </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='Ethernet.html'>Ethernet</a> : <em>Client</em> class
|
||||
</p>
|
||||
<p class='vspace'></p><h2>write()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Write data to the server the client is connected to.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p><em>client</em>.write(data)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>data: the byte or char to write
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
88
arduino-0018-linux/reference/Comments.html
Normal file
88
arduino-0018-linux/reference/Comments.html
Normal file
|
@ -0,0 +1,88 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Comments </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Comments</h2>
|
||||
<p>Comments are lines in the program that are used to inform yourself or others about the way the program works. They are ignored by the compiler, and not exported to the processor, so they don't take up any space on the Atmega chip.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Comments only purpose are to help you understand (or remember) how your program works or to inform others how your program works.
|
||||
There are two different ways of marking a line as a comment:
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre> x = 5; // This is a single line comment. Anything after the slashes is a comment
|
||||
// to the end of the line
|
||||
|
||||
/* this is multiline comment - use it to comment out whole blocks of code
|
||||
|
||||
if (gwb == 0){ // single line comment is OK inside a multiline comment
|
||||
x = 3; /* but not another multiline comment - this is invalid */
|
||||
}
|
||||
// don't forget the "closing" comment - they have to be balanced!
|
||||
*/
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><strong>Tip</strong><br />When experimenting with code, "commenting out" parts of your program is a convenient way to remove lines that may be buggy. This leaves the lines in the code, but turns them into comments, so the compiler just ignores them. This can be especially useful when trying to locate a problem, or when a program refuses to compile and the compiler error is cryptic or unhelpful.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
94
arduino-0018-linux/reference/Comparison.html
Normal file
94
arduino-0018-linux/reference/Comparison.html
Normal file
|
@ -0,0 +1,94 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Comparison </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='selflink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Arduino/Processing Language Comparison</h2>
|
||||
<p>The Arduino language (based on Wiring) is implemented in C/C++, and therefore has some differences from the Processing language, which is based on Java.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Arrays</h3>
|
||||
<table width='75%' cellspacing='0' cellpadding='5'><tr><td width='50%' bgcolor='#999999' valign='top'> <em>Arduino</em>
|
||||
</td><td width='50%' bgcolor='#CCCCCC' valign='top'> <em>Processing</em>
|
||||
</td></tr><tr><td valign='top'> int bar[8]; <br clear='all' /> bar[0] = 1;
|
||||
</td><td valign='top'> int[] bar = new int[8]; <br clear='all' /> bar[0] = 1;
|
||||
</td></tr><tr><td bgcolor='#999999' valign='top'> int foo[] = { 0, 1, 2 };
|
||||
</td><td bgcolor='#CCCCCC' valign='top'> int foo[] = { 0, 1, 2 }; <br clear='all' /> <em>or</em> <br clear='all' /> int[] foo = { 0, 1, 2 };
|
||||
</td></tr></table>
|
||||
<p class='vspace'></p><h3>Loops</h3>
|
||||
<table width='75%' cellspacing='0' cellpadding='5'><tr><td width='50%' bgcolor='#999999' valign='top'> <em>Arduino</em>
|
||||
</td><td width='50%' bgcolor='#CCCCCC' valign='top'> <em>Processing</em>
|
||||
</td></tr><tr><td valign='top'> int i; <br clear='all' /> for (i = 0; i < 5; i++) { ... }
|
||||
</td><td valign='top'> for (int i = 0; i < 5; i++) { ... }
|
||||
</td></tr></table>
|
||||
<p class='vspace'></p><h3>Printing</h3>
|
||||
<table width='75%' cellspacing='0' cellpadding='5'><tr><td width='50%' bgcolor='#999999' valign='top'> <em>Arduino</em>
|
||||
</td><td width='50%' bgcolor='#CCCCCC' valign='top'> <em>Processing</em>
|
||||
</td></tr><tr><td valign='top'> Serial.println("hello world");
|
||||
</td><td valign='top'> println("hello world");
|
||||
</td></tr><tr><td bgcolor='#999999' valign='top'> int i = 5; <br clear='all' /> Serial.println(i);
|
||||
</td><td bgcolor='#CCCCCC' valign='top'> int i = 5; <br clear='all' /> println(i);
|
||||
</td></tr><tr><td valign='top'> int i = 5; <br clear='all' /> Serial.print("i = "); <br clear='all' /> Serial.print(i); <br clear='all' /> Serial.println();
|
||||
</td><td valign='top'> int i = 5; <br clear='all' /> println("i = " + i);
|
||||
</td></tr></table>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
90
arduino-0018-linux/reference/Const.html
Normal file
90
arduino-0018-linux/reference/Const.html
Normal file
|
@ -0,0 +1,90 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Const </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>const keyword</h2>
|
||||
<p>The <strong>const</strong> keyword stands for constant. It is a variable <em>qualifier</em> that modifies the behavior of the variable, making a variable "<em>read-only</em>". This means that the variable can be used just as any other variable of its type, but its value cannot be changed. You will get a compiler error if you try to assign a value to a <strong>const</strong> variable.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Constants defined with the <em>const</em> keyword obey the rules of <em><a class='wikilink' href='Scope.html'>variable scoping</a></em> that govern other variables. This, and the pitfalls of using<em>#define</em>, makes the <em>const</em> keyword a superior method for defining constants and is preferred over using <em><a class='wikilink' href='Define.html'>#define</a></em>.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
const float pi = 3.14;
|
||||
float x;
|
||||
|
||||
// ....
|
||||
|
||||
x = pi * 2; // it's fine to use const's in math
|
||||
|
||||
pi = 7; // illegal - you can't write to (modify) a constant
|
||||
|
||||
|
||||
</pre><h4><strong>#define</strong> or <strong>const</strong></h4>
|
||||
<p>You can use either <strong>const</strong> or <strong>#define</strong> for creating numeric or string constants. For <a class='wikilink' href='Array.html'>arrays</a>, you will need to use <strong>const</strong>. In general <em>const</em> is preferred over <em>#define</em> for defining constants.
|
||||
</p>
|
||||
<p class='vspace'></p><p>See also:
|
||||
</p><ul><li><a class='wikilink' href='Define.html'>#define</a>
|
||||
</li><li><a class='wikilink' href='Volatile.html'>volatile</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
112
arduino-0018-linux/reference/Constants.html
Normal file
112
arduino-0018-linux/reference/Constants.html
Normal file
|
@ -0,0 +1,112 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Constants </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>constants</h2>
|
||||
<p>Constants are predefined variables in the Arduino language. They are used to make the programs easier to read. We classify constants in groups.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Defining Logical Levels, true and false (Boolean Constants)</h3>
|
||||
<p>There are two constants used to represent truth and falsity in the Arduino language: <strong>true</strong>, and <strong>false</strong>.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>false</h4>
|
||||
<p>false is the easier of the two to define. false is defined as 0 (zero).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>true</h4>
|
||||
<p>true is often said to be defined as 1, which is correct, but true has a wider definition. Any integer which is <em>non-zero</em> is TRUE, in a Boolean sense. So -1, 2 and -200 are all defined as true, too, in a Boolean sense.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Note that the <em>true</em> and <em>false</em> constants are typed in lowercase unlike HIGH, LOW, INPUT, & OUTPUT.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Defining Pin Levels, HIGH and LOW</h3>
|
||||
<p>When reading or writing to a digital pin there are only two possible values a pin can take/be-set-to: <strong>HIGH</strong> and <strong>LOW</strong>.
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>HIGH</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The meaning of HIGH (in reference to a pin) is somewhat different depending on whether a pin is set to an INPUT or OUTPUT.
|
||||
When a pin is configured as an INPUT with pinMode, and read with digitalRead, the microcontroller will report HIGH if a voltage of 3 volts or more is present at the pin.
|
||||
</p>
|
||||
<p class='vspace'></p><p>A pin may also be configured as an INPUT with pinMode, and subsequently made HIGH with digitalWrite, this will set the internal 20K pullup resistors, which will <em>steer</em> the input pin to a HIGH reading unless it is pulled LOW by external circuitry.
|
||||
</p>
|
||||
<p class='vspace'></p><p>When a pin is configured to OUTPUT with pinMode, and set to HIGH with digitalWrite, the pin is at 5 volts. In this state it can <em>source</em> current, e.g. light an LED that is connected through a series resistor to ground, or to another pin configured as an output, and set to LOW.
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>LOW</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The meaning of LOW also has a different meaning depending on whether a pin is set to INPUT or OUTPUT. When a pin is configured as an INPUT with pinMode, and read with digitalRead, the microcontroller will report LOW if a voltage of 2 volts or less is present at the pin.
|
||||
</p>
|
||||
<p class='vspace'></p><p>When a pin is configured to OUTPUT with pinMode, and set to LOW with digitalWrite, the pin is at 0 volts. In this state it can <em>sink</em> current, e.g. light an LED that is connected through a series resistor to, +5 volts, or to another pin configured as an output, and set to HIGH.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Defining Digital Pins, INPUT and OUTPUT</h3>
|
||||
<p>Digital pins can be used either as <strong>INPUT</strong> or <strong>OUTPUT</strong>. Changing a pin from INPUT TO OUTPUT with pinMode() drastically changes the electrical behavior of the pin.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Pins Configured as Inputs</h4>
|
||||
<p>Arduino (Atmega) pins configured as <strong>INPUT</strong> with pinMode() are said to be in a high-impedance state. One way of explaining this is that pins configured as INPUT make extremely small demands on the circuit that they are sampling, say equivalent to a series resistor of 100 Megohms in front of the pin. This makes them useful for reading a sensor, but not powering an LED.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Pins Configured as Outputs</h4>
|
||||
<p>Pins configured as <strong>OUTPUT</strong> with pinMode() are said to be in a low-impedance state. This means that they can provide a substantial amount of current to other circuits. Atmega pins can source (provide positive current) or sink (provide negative current) up to 40 mA (milliamps) of current to other devices/circuits. This makes them useful for powering LED's but useless for reading sensors. Pins configured as outputs can also be damaged or destroyed if short circuited to either ground or 5 volt power rails. The amount of current provided by an Atmega pin is also not enough to power most relays or motors, and some interface circuitry will be required.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='PinMode.html'>pinMode()</a>
|
||||
</li><li><a class='wikilink' href='IntegerConstants.html'>Integer Constants</a>
|
||||
</li><li><a class='wikilink' href='BooleanVariables.html'>boolean variables</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
92
arduino-0018-linux/reference/Constrain.html
Normal file
92
arduino-0018-linux/reference/Constrain.html
Normal file
|
@ -0,0 +1,92 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Constrain </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>constrain(x, a, b)</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Constrains a number to be within a range.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>x: the number to constrain, all data types
|
||||
</p>
|
||||
<p class='vspace'></p><p>a: the lower end of the range, all data types
|
||||
</p>
|
||||
<p class='vspace'></p><p>b: the upper end of the range, all data types
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p><strong>x</strong>: if <strong>x</strong> is between <strong>a</strong> and <strong>b</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>a</strong>: if <strong>x</strong> is less than <strong>a</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>b</strong>: if <strong>x</strong> is greater than <strong>b</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>sensVal = constrain(sensVal, 10, 150);
|
||||
// limits range of sensor values to between 10 and 150
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='Min.html'>min</a>()
|
||||
</li><li><a class='wikilink' href='Max.html'>max</a>()
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
84
arduino-0018-linux/reference/Continue.html
Normal file
84
arduino-0018-linux/reference/Continue.html
Normal file
|
@ -0,0 +1,84 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Continue </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>continue</h2>
|
||||
<p>The continue statement skips the rest of the current iteration of a loop (<strong>do</strong>, <strong>for</strong>, or <strong>while</strong>). It continues by checking the conditional expression of the loop, and proceeding with any subsequent iterations.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
|
||||
for (x = 0; x < 255; x ++)
|
||||
{
|
||||
if (x > 40 && x < 120){ // create jump in values
|
||||
continue;
|
||||
}
|
||||
|
||||
digitalWrite(PWMpin, x);
|
||||
delay(50);
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
84
arduino-0018-linux/reference/Cos.html
Normal file
84
arduino-0018-linux/reference/Cos.html
Normal file
|
@ -0,0 +1,84 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Cos </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>cos(rad)</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Calculates the cos of an angle (in radians). The result will be between -1 and 1.<br />
|
||||
</p><h4>Parameters</h4>
|
||||
<p>rad: the angle in radians (<em>float</em>)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>The cos of the angle ("double")
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Note</h4>
|
||||
<p>Serial.print() and Serial.println() do not currently support printing floats.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='Sin.html'>sin</a>()
|
||||
</li><li><a class='wikilink' href='Tan.html'>tan</a>()
|
||||
</li><li><a class='wikilink' href='Float.html'>float</a>
|
||||
</li><li><a class='wikilink' href='Double.html'>double</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
99
arduino-0018-linux/reference/Define.html
Normal file
99
arduino-0018-linux/reference/Define.html
Normal file
|
@ -0,0 +1,99 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Define </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Define</h2>
|
||||
<p><code>#define</code> is a useful C component that allows the programmer to give a name to a constant value before the program is compiled. Defined constants in arduino don't take up any program memory space on the chip. The compiler will replace references to these constants with the defined value at compile time.
|
||||
</p>
|
||||
<p class='vspace'></p><p>This can have some unwanted side effects though, if for example, a constant name that had been #defined is included in some other constant or variable name. In that case the text would be replaced by the #defined number (or text).
|
||||
</p>
|
||||
<p class='vspace'></p><p>In general, the <em><a class='wikilink' href='Const.html'>const</a></em> keyword is preferred for defining constants and should be used instead of #define.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Arduino defines have the same syntax as C defines:
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p><code>#define constantName value</code>
|
||||
</p>
|
||||
<p class='vspace'></p><p>Note that the # is necessary.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>#define ledPin 3
|
||||
// The compiler will replace any mention of ledPin with the value 3 at compile time.
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Tip</h4>
|
||||
<p>There is no semicolon after the #define statement. If you include one, the compiler will throw cryptic errors further down the page.
|
||||
</p>
|
||||
<p class='vspace'></p><pre>#define ledPin 3; // this is an error
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p>Similarly, including an equal sign after the #define statement will also generate a cryptic compiler error further down the page.
|
||||
</p>
|
||||
<p class='vspace'></p><pre>#define ledPin = 3 // this is also an error
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>See</h4>
|
||||
<ul><li><a class='wikilink' href='Const.html'>const</a>
|
||||
</li><li><a class='wikilink' href='IntegerConstants.html'>Constants</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
108
arduino-0018-linux/reference/Delay.html
Normal file
108
arduino-0018-linux/reference/Delay.html
Normal file
|
@ -0,0 +1,108 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Delay </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>delay()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Pauses the program for the amount of time (in miliseconds) specified as parameter. (There are 1000 milliseconds in a second.)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>delay(ms)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>ms: the number of milliseconds to pause (<em>unsigned long</em>)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>nothing
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
int ledPin = 13; // LED connected to digital pin 13
|
||||
|
||||
void setup()
|
||||
{
|
||||
pinMode(ledPin, OUTPUT); // sets the digital pin as output
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
digitalWrite(ledPin, HIGH); // sets the LED on
|
||||
delay(1000); // waits for a second
|
||||
digitalWrite(ledPin, LOW); // sets the LED off
|
||||
delay(1000); // waits for a second
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Caveat</h4>
|
||||
<p>While it is easy to create a blinking LED with the delay() function, and many sketches use short delays for such tasks as switch debouncing, the use of delay() in a sketch has significant drawbacks. No other reading of sensors, mathematical calculations, or pin manipulation can go on during the delay function, so in effect, it brings most other activity to a halt. For alternative approaches to controlling timing see the <a class='wikilink' href='Millis.html'>millis()</a> function and the sketch sited below. More knowledgeable programmers usually avoid the use of delay() for timing of events longer than 10's of milliseconds unless the Arduino sketch is very simple.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Certain things <em>do</em> go on while the delay() function is controlling the Atmega chip however, because the delay function does not disable interrupts. Serial communication that appears at the RX pin is recorded, PWM (<a class='wikilink' href='AnalogWrite.html'>analogWrite</a>) values and pin states are maintained, and <a class='wikilink' href='AttachInterrupt.html'>interrupts</a> will work as they should.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='Millis.html'>millis</a>()
|
||||
</li><li><a class='wikilink' href='Micros.html'>micros</a>()
|
||||
</li><li><a class='wikilink' href='DelayMicroseconds.html'>delayMicroseconds</a>()
|
||||
</li><li><a class='wikilink' href='http://arduino.cc/en/Tutorial/BlinkWithoutDelay'>Blink Without Delay</a> example
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
110
arduino-0018-linux/reference/DelayMicroseconds.html
Normal file
110
arduino-0018-linux/reference/DelayMicroseconds.html
Normal file
|
@ -0,0 +1,110 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - DelayMicroseconds </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>delayMicroseconds()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Pauses the program for the amount of time (in microseconds) specified as parameter. There are a thousand microseconds in a millisecond, and a million microseconds in a second.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Currently, the largest value that will produce an accurate delay is 16383. This could change in future Arduino releases. For delays longer than a few thousand microseconds, you should use delay() instead.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>us: the number of microseconds to pause (<em>unsigned int</em>)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>None
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
int outPin = 8; // digital pin 8
|
||||
|
||||
void setup()
|
||||
{
|
||||
pinMode(outPin, OUTPUT); // sets the digital pin as output
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
digitalWrite(outPin, HIGH); // sets the pin on
|
||||
delayMicroseconds(50); // pauses for 50 microseconds
|
||||
digitalWrite(outPin, LOW); // sets the pin off
|
||||
delayMicroseconds(50); // pauses for 50 microseconds
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p>configures pin number 8 to work as an output pin. It sends a train of pulses with 100 microseconds period.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Caveats and Known Issues</h4>
|
||||
<p>This function works very accurately in the range 3 microseconds and up. We cannot assure that delayMicroseconds will perform precisely for smaller delay-times.
|
||||
</p>
|
||||
<p class='vspace'></p><p>To ensure more accurate delays, this functions disables interrupts during its operation, meaning that some things (like receiving serial data, or incrementing the value returned by millis()) will not happen during the delay. Thus, you should only use this function for short delays, and use delay() for longer ones.
|
||||
</p>
|
||||
<p class='vspace'></p><p>delayMicroseconds(0) will generate a much longer delay than expected (~1020 us) as will using negative numbers as a parameter.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='Millis.html'>millis</a>()
|
||||
</li><li><a class='wikilink' href='Micros.html'>micros</a>()
|
||||
</li><li><a class='wikilink' href='Delay.html'>delay</a>()
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
76
arduino-0018-linux/reference/DetachInterrupt.html
Normal file
76
arduino-0018-linux/reference/DetachInterrupt.html
Normal file
|
@ -0,0 +1,76 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - DetachInterrupt </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>detachInterrupt(interrupt)</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Turns off the given interrupt.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>interrupt: the number of interrupt to disable (0 or 1).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='AttachInterrupt.html'>attachInterrupt</a>()
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
110
arduino-0018-linux/reference/DigitalRead.html
Normal file
110
arduino-0018-linux/reference/DigitalRead.html
Normal file
|
@ -0,0 +1,110 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - DigitalRead </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>digitalRead()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Reads the value from a specified digital pin, either <a class='wikilink' href='Constants.html'>HIGH</a> or <a class='wikilink' href='Constants.html'>LOW</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>digitalRead(pin)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>pin: the number of the digital pin you want to read (<em>int</em>)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p><a class='wikilink' href='Constants.html'>HIGH</a> or <a class='wikilink' href='Constants.html'>LOW</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
int ledPin = 13; // LED connected to digital pin 13
|
||||
int inPin = 7; // pushbutton connected to digital pin 7
|
||||
int val = 0; // variable to store the read value
|
||||
|
||||
void setup()
|
||||
{
|
||||
pinMode(ledPin, OUTPUT); // sets the digital pin 13 as output
|
||||
pinMode(inPin, INPUT); // sets the digital pin 7 as input
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
val = digitalRead(inPin); // read the input pin
|
||||
digitalWrite(ledPin, val); // sets the LED to the button's value
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p>Sets pin 13 to the same value as the pin 7, which is an input.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Note</h4>
|
||||
<p>If the pin isn't connected to anything, digitalRead() can return either HIGH or LOW (and this can change randomly).
|
||||
</p>
|
||||
<p class='vspace'></p><p>The analog input pins can be used as digital pins w/ numbers 14 (analog input 0) to 19 (analog input 5).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='PinMode.html'>pinMode</a>()
|
||||
</li><li><a class='wikilink' href='DigitalWrite.html'>digitalWrite</a>()
|
||||
</li><li><a class='wikilink' href='http://arduino.cc/en/Tutorial/DigitalPins'>Tutorial: Digital Pins</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
113
arduino-0018-linux/reference/DigitalWrite.html
Normal file
113
arduino-0018-linux/reference/DigitalWrite.html
Normal file
|
@ -0,0 +1,113 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - DigitalWrite </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>digitalWrite()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Write a <a class='wikilink' href='Constants.html'>HIGH</a> or a <a class='wikilink' href='Constants.html'>LOW</a> value to a digital pin.
|
||||
</p>
|
||||
<p class='vspace'></p><p>If the pin has been configured as an OUTPUT with <a class='wikilink' href='PinMode.html'>pinMode</a>(), its voltage will be set to the corresponding value: 5V (or 3.3V on 3.3V boards) for HIGH, 0V (ground) for LOW.
|
||||
</p>
|
||||
<p class='vspace'></p><p>If the pin is configured as an INPUT, writing a HIGH value with digitalWrite() will enable an internal 20K pullup resistor (see the <a class='wikilink' href='http://arduino.cc/en/Tutorial/DigitalPins'>tutorial on digital pins</a>). Writing LOW will disable the pullup. The pullup resistor is enough to light an LED dimly, so if <span class='wikiword'>LEDs</span> appear to work, but very dimly, this is a likely cause. The remedy is to set the pin to an output with the pinMode() function.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>digitalWrite(pin, value)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>pin: the pin number
|
||||
</p>
|
||||
<p class='vspace'></p><p>value: <a class='wikilink' href='Constants.html'>HIGH</a> or <a class='wikilink' href='Constants.html'>LOW</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>none
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
int ledPin = 13; // LED connected to digital pin 13
|
||||
|
||||
void setup()
|
||||
{
|
||||
pinMode(ledPin, OUTPUT); // sets the digital pin as output
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
digitalWrite(ledPin, HIGH); // sets the LED on
|
||||
delay(1000); // waits for a second
|
||||
digitalWrite(ledPin, LOW); // sets the LED off
|
||||
delay(1000); // waits for a second
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p>Sets pin 13 to HIGH, makes a one-second-long delay, and sets the pin back to LOW.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Note</h4>
|
||||
<p>The analog input pins can also be used as digital pins, referred to as numbers 14 (analog input 0) to 19 (analog input 5).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='PinMode.html'>pinMode</a>()
|
||||
</li><li><a class='wikilink' href='DigitalRead.html'>digitalRead</a>()
|
||||
</li><li><a class='wikilink' href='http://arduino.cc/en/Tutorial/DigitalPins'>Tutorial: Digital Pins</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
87
arduino-0018-linux/reference/DoWhile.html
Normal file
87
arduino-0018-linux/reference/DoWhile.html
Normal file
|
@ -0,0 +1,87 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - DoWhile </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>do - while</h2>
|
||||
<p>The <strong>do</strong> loop works in the same manner as the <strong>while</strong> loop, with the exception that the condition is tested at the end of the loop, so the <strong>do</strong> loop will <em>always</em> run at least once.
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
do
|
||||
{
|
||||
// statement block
|
||||
} while (test condition);
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
do
|
||||
{
|
||||
delay(50); // wait for sensors to stabilize
|
||||
x = readSensors(); // check the sensors
|
||||
|
||||
} while (x < 100);
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
78
arduino-0018-linux/reference/Double.html
Normal file
78
arduino-0018-linux/reference/Double.html
Normal file
|
@ -0,0 +1,78 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Double </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>double</h2>
|
||||
<h4>Desciption</h4>
|
||||
<p>Double precision floating point number. Occupies 4 bytes.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The double implementation on the Arduino is currently exactly the same as the float, with no gain in precision.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Tip</h4>
|
||||
<p>Users who borrow code from other sources that includes double variables may wish to examine the code to see if the implied precision is different from that actually achieved on the Arduino.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See:</h4>
|
||||
<ul><li><a class='wikilink' href='Float.html'>float</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
73
arduino-0018-linux/reference/EEPROM.html
Normal file
73
arduino-0018-linux/reference/EEPROM.html
Normal file
|
@ -0,0 +1,73 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - EEPROM </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>EEPROM Library</h2>
|
||||
<p>The microcontroller on the Arduino board has 512 bytes of EEPROM: memory whose values are kept when the board is turned off (like a tiny hard drive). This library enables you to read and write those bytes.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Functions</h4>
|
||||
<ul><li><a class='wikilink' href='EEPROMRead.html'>read()</a>
|
||||
</li><li><a class='wikilink' href='EEPROMWrite.html'>write()</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
109
arduino-0018-linux/reference/EEPROMRead.html
Normal file
109
arduino-0018-linux/reference/EEPROMRead.html
Normal file
|
@ -0,0 +1,109 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - EEPROMRead </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>byte EEPROM.read(address)</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Reads a byte from the EEPROM. Locations that have never been written to have the value of 255.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>address: the location to read from, from 0 to 511 (<em>int</em>)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>the value stored in that location (<em>byte</em>)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
#include <EEPROM.h>
|
||||
|
||||
int a = 0;
|
||||
int value;
|
||||
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
value = EEPROM.read(a);
|
||||
|
||||
Serial.print(a);
|
||||
Serial.print("\t");
|
||||
Serial.print(value);
|
||||
Serial.println();
|
||||
|
||||
a = a + 1;
|
||||
|
||||
if (a == 512)
|
||||
a = 0;
|
||||
|
||||
delay(500);
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='EEPROMWrite.html'>EEPROM.write</a>()
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
102
arduino-0018-linux/reference/EEPROMWrite.html
Normal file
102
arduino-0018-linux/reference/EEPROMWrite.html
Normal file
|
@ -0,0 +1,102 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - EEPROMWrite </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>EEPROM.write(address, value)</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Write a byte to the EEPROM.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>address: the location to write to, from 0 to 511 (<em>int</em>)
|
||||
</p>
|
||||
<p class='vspace'></p><p>value: the value to write, from 0 to 255 (<em>byte</em>)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>none
|
||||
</p>
|
||||
<p class='vspace'></p><p>The Atmega 168 datasheet says that EEPROM memory has a specified life of 100000 write/erase cycles, so there is a limit to how many times you can write information to that memory space. Keep this in mind for long-lived projects or fast-moving data.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The datasheet also specifies that a write cycle takes 3.3 ms to complete. Other EEPROM write and read requests will fail if executed in this time period. This delay appears to be built into the EEPROM library as a casual test shows each cycle taking 3.33 ms to execute.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Hence, you do not specifically need to add a delay to an EEPROM write, just be aware of the built-in time delay.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
#include <EEPROM.h>
|
||||
|
||||
void setup()
|
||||
{
|
||||
for (int i = 0; i < 512; i++)
|
||||
EEPROM.write(i, i);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='EEPROMRead.html'>EEPROM.read</a>()
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
103
arduino-0018-linux/reference/Else.html
Normal file
103
arduino-0018-linux/reference/Else.html
Normal file
|
@ -0,0 +1,103 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Else </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>if / else</h2>
|
||||
<p><strong>if/else</strong> allows greater control over the flow of code than the basic <strong>if</strong> statement, by allowing multiple tests to be grouped together. For example, an analog input could be tested and one action taken if the input was less than 500, and another action taken if the input was 500 or greater. The code would look like this:
|
||||
</p>
|
||||
<p class='vspace'></p><pre>if (pinFiveInput < 500)
|
||||
{
|
||||
// action A
|
||||
}
|
||||
else
|
||||
{
|
||||
// action B
|
||||
}
|
||||
</pre>
|
||||
<p class='vspace'></p><p><strong>else</strong> can proceed another <strong>if</strong> test, so that multiple, mutually exclusive tests can be run at the same time.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Each test will proceed to the next one until a true test is encountered. When a true test is found, its associated block of code is run, and the program then skips to the line following the entire if/else construction. If no test proves to be true, the default <strong>else</strong> block is executed, if one is present, and sets the default behavior.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Note that an <strong>else if</strong> block may be used with or without a terminating <strong>else</strong> block and vice versa. An unlimited number of such <strong>else if</strong> branches is allowed.
|
||||
</p>
|
||||
<p class='vspace'></p><pre>if (pinFiveInput < 500)
|
||||
{
|
||||
// do Thing A
|
||||
}
|
||||
else if (pinFiveInput >= 1000)
|
||||
{
|
||||
// do Thing B
|
||||
}
|
||||
else
|
||||
{
|
||||
// do Thing C
|
||||
}
|
||||
|
||||
</pre><p>Another way to express branching, mutually exclusive tests, is with the <a class='wikilink' href='SwitchCase.html'>switch case</a> statement.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also:</h4>
|
||||
<p><a class='wikilink' href='SwitchCase.html'>switch case</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
96
arduino-0018-linux/reference/Ethernet.html
Normal file
96
arduino-0018-linux/reference/Ethernet.html
Normal file
|
@ -0,0 +1,96 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Ethernet </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Ethernet library</h2>
|
||||
<p>With the Arduino Ethernet Shield, this library allows an Arduino board to connect to the internet. It can serve as either a server accepting incoming connections or a client making outgoing ones. The library supports up to four concurrent connection (incoming or outgoing or a combination).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Ethernet class</h4>
|
||||
<p>The Ethernet class initializes the ethernet library and network settings.
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><a class='wikilink' href='EthernetBegin.html'>begin()</a>
|
||||
</li></ul><p class='vspace'></p><h4>Server class</h4>
|
||||
<p>The Server class creates servers which can send data to and receive data from connected clients (programs running on other computers or devices).
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><a class='wikilink' href='ServerConstructor.html'>Server()</a>
|
||||
</li><li><a class='wikilink' href='ServerBegin.html'>begin()</a>
|
||||
</li><li><a class='wikilink' href='ServerAvailable.html'>available()</a>
|
||||
</li><li><a class='wikilink' href='ServerWrite.html'>write()</a>
|
||||
</li><li><a class='wikilink' href='ServerPrint.html'>print()</a>
|
||||
</li><li><a class='wikilink' href='ServerPrintln.html'>println()</a>
|
||||
</li></ul><p class='vspace'></p><h4>Client class</h4>
|
||||
<p>The client class creates clients that can connect to servers and send and receive data.
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><a class='wikilink' href='ClientConstructor.html'>Client()</a>
|
||||
</li><li><a class='wikilink' href='ClientConnected.html'>connected()</a>
|
||||
</li><li><a class='wikilink' href='ClientConnect.html'>connect()</a>
|
||||
</li><li><a class='wikilink' href='ClientWrite.html'>write()</a>
|
||||
</li><li><a class='wikilink' href='ClientPrint.html'>print()</a>
|
||||
</li><li><a class='wikilink' href='ClientPrintln.html'>println()</a>
|
||||
</li><li><a class='wikilink' href='ClientAvailable.html'>available()</a>
|
||||
</li><li><a class='wikilink' href='ClientRead.html'>read()</a>
|
||||
</li><li><a class='wikilink' href='ClientFlush.html'>flush()</a>
|
||||
</li><li><a class='wikilink' href='ClientStop.html'>stop()</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
102
arduino-0018-linux/reference/EthernetBegin.html
Normal file
102
arduino-0018-linux/reference/EthernetBegin.html
Normal file
|
@ -0,0 +1,102 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - EthernetBegin </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='Ethernet.html'>Ethernet</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Ethernet.begin()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Initializes the ethernet library and network settings.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>Ethernet.begin(mac, ip); <br />Ethernet.begin(mac, ip, gateway); <br />Ethernet.begin(mac, ip, gateway, subnet); <br />
|
||||
</p><h4>Parameters</h4>
|
||||
<p>mac: the MAC address for the device (array of 6 bytes)
|
||||
</p>
|
||||
<p class='vspace'></p><p>ip: the IP address of the device (array of 4 bytes)
|
||||
</p>
|
||||
<p class='vspace'></p><p>gateway: the IP address of the network gateway (array of 4 bytes). optional: defaults to the device IP address with the last octet set to 1
|
||||
</p>
|
||||
<p class='vspace'></p><p>subnet: the subnet mask of the network (array of 4 bytes). optional: defaults to 255.255.255.0
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>None
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
#include <Ethernet.h>
|
||||
|
||||
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
|
||||
byte ip[] = { 10, 0, 0, 177 };
|
||||
|
||||
void setup()
|
||||
{
|
||||
Ethernet.begin(mac, ip);
|
||||
}
|
||||
|
||||
void loop () {}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
226
arduino-0018-linux/reference/Extended.html
Normal file
226
arduino-0018-linux/reference/Extended.html
Normal file
|
@ -0,0 +1,226 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Extended Reference </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='selflink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h1>Language Reference (extended)</h1>
|
||||
<p>The Arduino language is based on C/C++ and supports all standard C constructs and some C++ features. It links against <a class='urllink' href='http://www.nongnu.org/avr-libc/' rel='nofollow'>AVR Libc</a> and allows the use of any of its functions; see its <a class='urllink' href='http://www.nongnu.org/avr-libc/user-manual/index.html' rel='nofollow'>user manual</a> for details.
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
<table width='100%' border='0' cellpadding='5' cellspacing='0'><tr><td width='50%' valign='top'>
|
||||
<h2>Structure</h2>
|
||||
<ul><li>void <a class='wikilink' href='Setup.html'>setup</a>()
|
||||
</li><li>void <a class='wikilink' href='Loop.html'>loop</a>()
|
||||
</li></ul><p class='vspace'></p><h4>Control Structures</h4>
|
||||
<ul><li><a class='wikilink' href='If.html'>if</a>
|
||||
</li><li><a class='wikilink' href='Else.html'>if...else</a>
|
||||
</li><li><a class='wikilink' href='For.html'>for</a>
|
||||
</li><li><a class='wikilink' href='SwitchCase.html'>switch case</a>
|
||||
</li><li><a class='wikilink' href='While.html'>while</a>
|
||||
</li><li><a class='wikilink' href='DoWhile.html'>do... while</a>
|
||||
</li><li><a class='wikilink' href='Break.html'>break</a>
|
||||
</li><li><a class='wikilink' href='Continue.html'>continue</a>
|
||||
</li><li><a class='wikilink' href='Return.html'>return</a>
|
||||
</li><li><a class='wikilink' href='Goto.html'>goto</a>
|
||||
</li></ul><p class='vspace'></p><h4>Further Syntax</h4>
|
||||
<ul><li><a class='wikilink' href='SemiColon.html'>;</a> (semicolon)
|
||||
</li><li><a class='wikilink' href='Braces.html'>{}</a> (curly braces)
|
||||
</li><li><a class='wikilink' href='Comments.html'>//</a> (single line comment)
|
||||
</li><li><a class='wikilink' href='Comments.html'>/* */</a> (multi-line comment)
|
||||
</li><li><a class='wikilink' href='Define.html'>#define</a>
|
||||
</li><li><a class='wikilink' href='Include.html'>#include</a>
|
||||
</li></ul><p class='vspace'></p><h4>Arithmetic Operators</h4>
|
||||
<ul><li><a class='wikilink' href='Assignment.html'>=</a> (assignment operator)
|
||||
</li><li><a class='wikilink' href='Arithmetic.html'>+ </a> (addition)
|
||||
</li><li><a class='wikilink' href='Arithmetic.html'>-</a> (subtraction)
|
||||
</li><li><a class='wikilink' href='Arithmetic.html'>*</a> (multiplication)
|
||||
</li><li><a class='wikilink' href='Arithmetic.html'>/</a> (division)
|
||||
</li><li><a class='wikilink' href='Modulo.html'>%</a> (modulo)
|
||||
</li></ul><p class='vspace'></p><h4>Comparison Operators</h4>
|
||||
<ul><li><a class='wikilink' href='If.html'>==</a> (equal to)
|
||||
</li><li><a class='wikilink' href='If.html'>!=</a> (not equal to)
|
||||
</li><li><a class='wikilink' href='If.html'><</a> (less than)
|
||||
</li><li><a class='wikilink' href='If.html'>></a> (greater than)
|
||||
</li><li><a class='wikilink' href='If.html'><=</a> (less than or equal to)
|
||||
</li><li><a class='wikilink' href='If.html'>>=</a> (greater than or equal to)
|
||||
</li></ul><p class='vspace'></p><h4>Boolean Operators</h4>
|
||||
<ul><li><a class='wikilink' href='Boolean.html'>&&</a> (and)
|
||||
</li><li><a class='wikilink' href='Boolean.html'>||</a> (or)
|
||||
</li><li><a class='wikilink' href='Boolean.html'>!</a> (not)
|
||||
</li></ul><p class='vspace'></p><h4>Pointer Access Operators</h4>
|
||||
<ul><li><a class='wikilink' href='Pointer.html'>* dereference operator</a>
|
||||
</li><li><a class='wikilink' href='Pointer.html'>& reference operator</a>
|
||||
</li></ul><p class='vspace'></p><h4>Bitwise Operators</h4>
|
||||
<ul><li><a class='wikilink' href='BitwiseAnd.html'>&</a> (bitwise and)
|
||||
</li><li><a class='wikilink' href='BitwiseAnd.html'>|</a> (bitwise or)
|
||||
</li><li><a class='wikilink' href='BitwiseAnd.html'>^</a> (bitwise xor)
|
||||
</li><li><a class='wikilink' href='BitwiseXorNot.html'>~</a> (bitwise not)
|
||||
</li><li><a class='wikilink' href='Bitshift.html'><<</a> (bitshift left)
|
||||
</li><li><a class='wikilink' href='Bitshift.html'>>></a> (bitshift right)
|
||||
<p class='vspace'></p></li><li><a class='wikilink' href='PortManipulation.html'>Port Manipulation</a>
|
||||
</li></ul><p class='vspace'></p><h4>Compound Operators</h4>
|
||||
<ul><li><a class='wikilink' href='Increment.html'>++</a> (increment)
|
||||
</li><li><a class='wikilink' href='Increment.html'>--</a> (decrement)
|
||||
</li><li><a class='wikilink' href='IncrementCompound.html'>+=</a> (compound addition)
|
||||
</li><li><a class='wikilink' href='IncrementCompound.html'>-=</a> (compound subtraction)
|
||||
</li><li><a class='wikilink' href='IncrementCompound.html'>*=</a> (compound multiplication)
|
||||
</li><li><a class='wikilink' href='IncrementCompound.html'>/=</a> (compound division)
|
||||
<p class='vspace'></p></li><li><a class='wikilink' href='BitwiseCompound.html'>&=</a> (compound bitwise and)
|
||||
</li><li><a class='wikilink' href='BitwiseCompound.html'>|=</a> (compound bitwise or)
|
||||
</li></ul><p class='vspace'></p><h2>Variables</h2>
|
||||
<h4>Constants</h4>
|
||||
<ul><li><a class='wikilink' href='Constants.html'>HIGH</a> | <a class='wikilink' href='Constants.html'>LOW</a>
|
||||
</li><li><a class='wikilink' href='Constants.html'>INPUT</a> | <a class='wikilink' href='Constants.html'>OUTPUT</a>
|
||||
</li><li><a class='wikilink' href='Constants.html'>true</a> | <a class='wikilink' href='Constants.html'>false</a>
|
||||
</li><li><a class='wikilink' href='IntegerConstants.html'>integer constants</a>
|
||||
</li><li><a class='wikilink' href='Fpconstants.html'>floating point constants</a>
|
||||
</li></ul><p class='vspace'></p><h4>Data Types</h4>
|
||||
<ul><li><a class='wikilink' href='Void.html'>void keyword</a>
|
||||
</li><li><a class='wikilink' href='BooleanVariables.html'>boolean</a>
|
||||
</li><li><a class='wikilink' href='Char.html'>char</a>
|
||||
</li><li><a class='wikilink' href='UnsignedChar.html'>unsigned char</a>
|
||||
</li><li><a class='wikilink' href='Byte.html'>byte</a>
|
||||
</li><li><a class='wikilink' href='Int.html'>int</a>
|
||||
</li><li><a class='wikilink' href='UnsignedInt.html'>unsigned int</a>
|
||||
</li><li><a class='wikilink' href='Word.html'>word</a>
|
||||
</li><li><a class='wikilink' href='Long.html'>long</a>
|
||||
</li><li><a class='wikilink' href='UnsignedLong.html'>unsigned long</a>
|
||||
</li><li><a class='wikilink' href='Float.html'>float</a>
|
||||
</li><li><a class='wikilink' href='Double.html'>double</a>
|
||||
</li><li><a class='wikilink' href='String.html'>string</a>
|
||||
</li><li><a class='wikilink' href='Array.html'>array</a>
|
||||
</li></ul><p class='vspace'></p><h4>Conversion</h4>
|
||||
<ul><li><a class='wikilink' href='CharCast.html'>char()</a>
|
||||
</li><li><a class='wikilink' href='ByteCast.html'>byte()</a>
|
||||
</li><li><a class='wikilink' href='IntCast.html'>int()</a>
|
||||
</li><li><a class='wikilink' href='WordCast.html'>word()</a>
|
||||
</li><li><a class='wikilink' href='LongCast.html'>long()</a>
|
||||
</li><li><a class='wikilink' href='FloatCast.html'>float()</a>
|
||||
</li></ul><p class='vspace'></p><h4>Variable Scope & Qualifiers</h4>
|
||||
<ul><li><a class='wikilink' href='Scope.html'>variable scope</a>
|
||||
</li><li><a class='wikilink' href='Static.html'>static</a>
|
||||
</li><li><a class='wikilink' href='Volatile.html'>volatile</a>
|
||||
</li><li><a class='wikilink' href='Const.html'>const</a>
|
||||
</li></ul><p class='vspace'></p><h4>Utilities</h4>
|
||||
<ul><li><a class='wikilink' href='Sizeof.html'>sizeof</a>() (sizeof operator)
|
||||
</li></ul><p class='vspace'></p><h2>Reference</h2>
|
||||
<ul><li><a class='wikilink' href='ASCIIchart.html'>ASCII chart</a>
|
||||
</li></ul></td><td width='50%' valign='top'>
|
||||
<p class='vspace'></p><h2>Functions</h2>
|
||||
<p><strong>Digital I/O</strong>
|
||||
</p><ul><li><a class='wikilink' href='PinMode.html'>pinMode</a>(pin, mode)
|
||||
</li><li><a class='wikilink' href='DigitalWrite.html'>digitalWrite</a>(pin, value)
|
||||
</li><li>int <a class='wikilink' href='DigitalRead.html'>digitalRead</a>(pin)
|
||||
</li></ul><p class='vspace'></p><p><strong>Analog I/O</strong>
|
||||
</p><ul><li><a class='wikilink' href='AnalogReference.html'>analogReference</a>(type)
|
||||
</li><li>int <a class='wikilink' href='AnalogRead.html'>analogRead</a>(pin)
|
||||
</li><li><a class='wikilink' href='AnalogWrite.html'>analogWrite</a>(pin, value) - <em>PWM</em>
|
||||
</li></ul><p class='vspace'></p><p><strong>Advanced I/O</strong>
|
||||
</p><ul><li><a class='wikilink' href='ShiftOut.html'>shiftOut</a>(dataPin, clockPin, bitOrder, value)
|
||||
</li><li>unsigned long <a class='wikilink' href='PulseIn.html'>pulseIn</a>(pin, value)
|
||||
</li></ul><p class='vspace'></p><p><strong>Time</strong>
|
||||
</p><ul><li>unsigned long <a class='wikilink' href='Millis.html'>millis</a>()
|
||||
</li><li>unsigned long <a class='wikilink' href='Micros.html'>micros</a>()
|
||||
</li><li><a class='wikilink' href='Delay.html'>delay</a>(ms)
|
||||
</li><li><a class='wikilink' href='DelayMicroseconds.html'>delayMicroseconds</a>(us)
|
||||
</li></ul><p class='vspace'></p><p><strong>Math</strong>
|
||||
</p><ul><li><a class='wikilink' href='Min.html'>min</a>(x, y)
|
||||
</li><li><a class='wikilink' href='Max.html'>max</a>(x, y)
|
||||
</li><li><a class='wikilink' href='Abs.html'>abs</a>(x)
|
||||
</li><li><a class='wikilink' href='Constrain.html'>constrain</a>(x, a, b)
|
||||
</li><li><a class='wikilink' href='Map.html'>map</a>(value, fromLow, fromHigh, toLow, toHigh)
|
||||
</li><li><a class='wikilink' href='Pow.html'>pow</a>(base, exponent)
|
||||
</li><li><a class='wikilink' href='Sqrt.html'>sqrt</a>(x)
|
||||
</li></ul><p class='vspace'></p><p><strong>Trigonometry</strong>
|
||||
</p><ul><li><a class='wikilink' href='Sin.html'>sin</a>(rad)
|
||||
</li><li><a class='wikilink' href='Cos.html'>cos</a>(rad)
|
||||
</li><li><a class='wikilink' href='Tan.html'>tan</a>(rad)
|
||||
</li></ul><p class='vspace'></p><p><strong>Random Numbers</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><a class='wikilink' href='RandomSeed.html'>randomSeed</a>(seed)
|
||||
</li><li>long <a class='wikilink' href='Random.html'>random</a>(max)
|
||||
</li><li>long <a class='wikilink' href='Random.html'>random</a>(min, max)
|
||||
</li></ul><p class='vspace'></p><p><strong>Bits and Bytes</strong>
|
||||
</p><ul><li><a class='wikilink' href='LowByte.html'>lowByte</a>()
|
||||
</li><li><a class='wikilink' href='HighByte.html'>highByte</a>()
|
||||
</li><li><a class='wikilink' href='BitRead.html'>bitRead</a>()
|
||||
</li><li><a class='wikilink' href='BitWrite.html'>bitWrite</a>()
|
||||
</li><li><a class='wikilink' href='BitSet.html'>bitSet</a>()
|
||||
</li><li><a class='wikilink' href='BitClear.html'>bitClear</a>()
|
||||
</li><li><a class='wikilink' href='Bit.html'>bit</a>()
|
||||
</li></ul><p class='vspace'></p><p><strong>External Interrupts</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><a class='wikilink' href='AttachInterrupt.html'>attachInterrupt</a>(interrupt, function, mode)
|
||||
</li><li><a class='wikilink' href='DetachInterrupt.html'>detachInterrupt</a>(interrupt)
|
||||
</li></ul><p class='vspace'></p><p><strong>Interrupts</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><a class='wikilink' href='Interrupts.html'>interrupts</a>()
|
||||
</li><li><a class='wikilink' href='NoInterrupts.html'>noInterrupts</a>()
|
||||
</li></ul><p class='vspace'></p><p><strong>Communication</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><a class='wikilink' href='Serial.html'>Serial</a>
|
||||
</li></ul><p class='vspace'></p><p><strong>Looking for something else?</strong> Try the list of <a class='urllink' href='http://www.arduino.cc/playground/Main/GeneralCodeLibrary' rel='nofollow'>community-contributed code</a>.
|
||||
</p>
|
||||
<p class='vspace'></p></td></tr></table>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
125
arduino-0018-linux/reference/FAQ.html
Normal file
125
arduino-0018-linux/reference/FAQ.html
Normal file
|
@ -0,0 +1,125 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - FAQ </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='selflink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<h2>Frequently Asked Questions</h2>
|
||||
<p><strong>What is an Arduino?</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p>Glad you asked, we have a great introduction page on Arduino, <a class='urllink' href='http://www.arduino.cc/en/Guide/Introduction' rel='nofollow'>click here to read it.</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>What do you mean by open-source hardware?</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p>Open-source hardware shares much of the principles and approach of free and open-source software. In particular, we believe that people should be able to study our hardware to understand how it works, make changes to it, and share those changes. To facilitate this, we release all of the original design files (Eagle CAD) for the Arduino hardware. These files are licensed under a Creative Commons Attribution Share-Alike license, which allows for both personal and commercial derivative works, as long as they credit Arduino and release their designs under the same license.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The Arduino software is also open-source. The source code for the Java environment is released under the GPL and the C/C++ microcontroller libraries are under the LGPL.
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>How can I get an Arduino board?</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p>You can buy an Arduino board from one of the distributors listed on the <a class='wikilink' href='http://arduino.cc/en/Main/Buy'>buy</a> page. If you'd prefer to build your own, see the <a class='wikilink' href='http://arduino.cc/en/Main/ArduinoBoardSerialSingleSided3'>Arduino Single-Sided Serial board</a>, which can be easily etched and assembled.
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>Who makes Arduino boards?</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p>Most of the official Arduino boards are manufactured by <span class='wikiword'>SmartProjects</span> in Italy. The Arduino Pro, Pro Mini, and <span class='wikiword'>LilyPad</span> are manufactured by <span class='wikiword'>SparkFun</span> Electronics (a US company). The Arduino Nano is manufactured by Gravitech (also a US company).
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>Which are the official Arduino boards?</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The official Arduino boards are the ones listed on the <a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>hardware page</a>: the Duemilanove, Nano, Mega, Bluetooth (BT), <span class='wikiword'>LilyPad</span>, Mini, Pro, Pro Mini, and a few older models, along with the Ethernet, <span class='wikiword'>XBee</span>, motor, and prototyping shields. These are boards whose manufacturers work with the Arduino team to ensure a good user experience, compatibility with the Arduino software, and a quality product. In return for their status as official boards, the manufacturers pay a licensing fee to the Arduino team to support the further development of the project.
|
||||
</p>
|
||||
<p class='vspace'></p><p>In general, we try to restrict use of the name “Arduino” to the official boards. If you find a product under a different name but described as “Arduino compatible”, it’s probably not an official board and doesn’t fund continued work on the project.
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>I want to design my own board; what should I do?</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The reference designs for the Arduino boards are available from the <a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>hardware</a> page. They're licensed under a Creative Commons Attribution Share-Alike license, so you are free to use and adapt them for your own needs without asking permission or paying a fee. If you're looking to make something of interest to the community, we'd encourage you to discuss your ideas on the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=hwdev' rel='nofollow'>hardware development forum</a> so that potential users can offer suggestions.
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>What should I call my boards?</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p>If you're making your own board, come up with your own name! This will allow people identify you with your products and help you to build a brand. Be creative: try to suggest what people might use the board for, or emphasize the form factor, or just pick a random word that sounds cool. "Arduino" is a trademark of Arduino team and should not be used for unofficial variants. If you're interested in having your design included in the official Arduino product line, please see the <a class='wikilink' href='http://arduino.cc/en/Main/Policy'>So you want to make an Arduino</a> document and contact the Arduino team. Note that while we don't attempt to restrict uses of the "duino" suffix, its use causes the Italians on the team to cringe (apparently it sounds terrible); you might want to avoid it.
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>Can I build a commercial product based on Arduino?</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p>Yes, with the following conditions:
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li>Physically embedding an Arduino board inside a commercial product does not require you to disclose or open-source any information about its design.
|
||||
<p class='vspace'></p></li><li>Deriving the design of a commercial product from the Eagle files for an Arduino board requires you to release the modified files under the same Creative Commons Attribution Share-Alike license. You may manufacture and sell the resulting product.
|
||||
<p class='vspace'></p></li><li>Using the Arduino core and libraries for the firmware of a commercial product does not require you to release the source code for the firmware. The LGPL does, however, require you to make available object files that allow for the relinking of the firmware against updated versions of the Arduino core and libraries. Any modifications to the core and libraries must be released under the LGPL.
|
||||
<p class='vspace'></p></li><li>The source code for the Arduino environment is covered by the GPL, which requires any modifications to be open-sourced under the same license. It does not prevent the sale of derivative software or its inclusion in commercial products.
|
||||
</li></ul><p class='vspace'></p><p>In all cases, the exact requirements are determined by the applicable license. Additionally, see the previous question for information about the use of the name “Arduino”.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a name='linux' id='linux'></a>
|
||||
<strong>How can I run the Arduino IDE under Linux?</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p>See instructions <a class='urllink' href='http://www.arduino.cc/playground/Linux/Ubuntu' rel='nofollow'>for Ubuntu Linux</a>, <a class='urllink' href='http://www.arduino.cc/playground/Linux/Debian' rel='nofollow'>for Debian Linux</a>, <a class='urllink' href='http://www.arduino.cc/playground/Linux/Gentoo' rel='nofollow'>for Gentoo Linux</a>, <a class='urllink' href='http://www.arduino.cc/playground/Learning/Linux' rel='nofollow'>for Linux</a>, or <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1141345598' rel='nofollow'>for Linux on PPC</a>. This <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1129025529' rel='nofollow'>this forum thread</a> has more information. Or, you can <a class='urllink' href='http://www.arduino.cc/playground/Learning/CommandLine' rel='nofollow'>use Arduino from the command line</a>, and not have to install Java.
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>Can I program the Arduino board in C?</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p>In fact, you already are; the Arduino language is merely a set of C/C++ functions that can be called from your code. Your sketch undergoes minor changes (e.g. automatic generation of function prototypes) and then is passed directly to a C/C++ compiler (avr-g++). All standard C and C++ constructs <a class='urllink' href='http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_cplusplus' rel='nofollow'>supported by avr-g++</a> should work in Arduino. For more details, see the page on the <a class='wikilink' href='http://arduino.cc/en/Hacking/BuildProcess'>Arduino build process</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>Can I use a different IDE to program the Arduino board?</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p>It is possible to compile programs for the Arduino using a <a class='wikilink' href='http://arduino.cc/en/Hacking/CommandLine'>Makefile and the command line</a>. If you can get your IDE to run make, you should be all set.
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>Can I use an Arduino board without the Arduino software?</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p>Sure. It's just an AVR development board, you can use straight AVR C or C++ (with avr-gcc and avrdude or AVR Studio) to program it.
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>Can I use the Arduino software with other AVR boards?</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p>Yes, although it may require some modifications to the Arduino core libraries. See the <a class='urllink' href='http://code.google.com/p/arduino/wiki/Porting' rel='nofollow'>porting page</a> in the Arduino Google Code project for details.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Troubleshooting</h3>
|
||||
<p>These questions have moved to the <a class='wikilink' href='Guide_Troubleshooting.html'>troubleshooting</a> section of the Arduino <a class='wikilink' href='Guide_index.html'>guide</a>.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='FAQ.html?action=edit'>Edit Page</a> | <a href='FAQ.html?action=diff'>Page History</a> | <a href='FAQ.html?action=print' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
98
arduino-0018-linux/reference/Float.html
Normal file
98
arduino-0018-linux/reference/Float.html
Normal file
|
@ -0,0 +1,98 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Float </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>float</h2>
|
||||
<h4>Description </h4>
|
||||
<p>Datatype for floating-point numbers, a number that has a decimal point. Floating-point numbers are often used to approximate analog and continuous values because they have greater resolution than integers. Floating-point numbers can be as large as 3.4028235E+38 and as low as -3.4028235E+38. They are stored as 32 bits (4 bytes) of information.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Floating point numbers are not exact, and may yield strange results when compared. For example <code>6.0 / 3.0</code> may not equal <code>2.0</code>. You should instead check that the absolute value of the difference between the numbers is less than some small number.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Floating point math is also much slower than integer math in performing calculations, so should be avoided if, for example, a loop has to run at top speed for a critical timing function. Programmers often go to some lengths to convert floating point calculations to integer math to increase speed.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Examples</h4>
|
||||
<pre> float myfloat;
|
||||
float sensorCalbrate = 1.117;
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<pre> float var = val;
|
||||
</pre>
|
||||
<p class='vspace'></p><ul><li>var - your float variable name
|
||||
</li><li>val - the value you assign to that variable
|
||||
</li></ul><p class='vspace'></p><h4>Example Code</h4>
|
||||
<pre>
|
||||
int x;
|
||||
int y;
|
||||
float z;
|
||||
|
||||
x = 1;
|
||||
y = x / 2; // y now contains 0, ints can't hold fractions
|
||||
z = (float)x / 2.0; // z now contains .5 (you have to use 2.0, not 2)
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>See Also</h4>
|
||||
<ul><li><a class='wikilink' href='Int.html'>int</a>
|
||||
</li><li><a class='wikilink' href='Double.html'>double</a>
|
||||
</li><li><a class='urllink' href='VariableDeclaration.html' rel='nofollow'>Variable Declaration</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
82
arduino-0018-linux/reference/FloatCast.html
Normal file
82
arduino-0018-linux/reference/FloatCast.html
Normal file
|
@ -0,0 +1,82 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - FloatCast </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>float()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Converts a value to the <a class='wikilink' href='Float.html'>float</a> data type.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>float(x)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>x: a value of any type
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>float
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='Float.html'>float</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
105
arduino-0018-linux/reference/For.html
Normal file
105
arduino-0018-linux/reference/For.html
Normal file
|
@ -0,0 +1,105 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - For </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>for statements</h2>
|
||||
<h4>Desciption</h4>
|
||||
<p>The <strong>for</strong> statement is used to repeat a block of statements enclosed in curly braces. An increment counter is usually used to increment and terminate the loop. The <strong>for</strong> statement is useful for any repetitive operation, and is often used in combination with arrays to operate on collections of data/pins.
|
||||
</p>
|
||||
<p class='vspace'></p><p>There are three parts to the <strong>for</strong> loop header:
|
||||
</p>
|
||||
<p class='vspace'></p><p><code><strong>for</strong> (<strong>initialization</strong>;<strong> condition</strong>;<strong> increment</strong>) {</code>
|
||||
</p>
|
||||
<p class='vspace'></p><p><code> //statement(s);</code>
|
||||
</p>
|
||||
<p class='vspace'></p><p><code>}</code>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The <strong>initialization</strong> happens first and exactly once. Each time through the loop, the <strong>condition</strong> is tested; if it's true, the statement block, and the <strong>increment</strong> is executed, then the <strong>condition</strong> is tested again. When the <strong>condition</strong> becomes false, the loop ends.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
// Dim an LED using a PWM pin
|
||||
int PWMpin = 10; // LED in series with 1k resistor on pin 10
|
||||
|
||||
void setup()
|
||||
{
|
||||
// no setup needed
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
for (int i=0; i <= 255; i++){
|
||||
analogWrite(PWMpin, i);
|
||||
delay(10);
|
||||
}
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Coding Tip</h4>
|
||||
<p>The C <strong>for</strong> loop is much more flexible than <strong>for</strong> loops found in some other computer languages, including BASIC. Any or all of the three header elements may be omitted, although the semicolons are required. Also the statements for initialization, condition, and increment can be any valid C statements with unrelated variables. These types of unusual <strong>for</strong> statements may provide solutions to some rare programming problems.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='While.html'>while</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
86
arduino-0018-linux/reference/Fpconstants.html
Normal file
86
arduino-0018-linux/reference/Fpconstants.html
Normal file
|
@ -0,0 +1,86 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Fpconstants </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>floating point constants</h2>
|
||||
<p>Similar to integer constants, floating point constants are used to make code more readable. Floating point constants are swapped at compile time for the value to which the expression evaluates.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Examples:
|
||||
</p>
|
||||
<p class='vspace'></p><p><code>n = .005; </code>
|
||||
</p>
|
||||
<p class='vspace'></p><p>Floating point constants can also be expressed in a variety of scientific notation. 'E' and 'e' are both accepted as valid exponent indicators.
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
|
||||
floating-point evaluates to: also evaluates to:
|
||||
constant
|
||||
|
||||
10.0 10
|
||||
2.34E5 2.34 * 10^5 234000
|
||||
67e-12 67.0 * 10^-12 .000000000067
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
140
arduino-0018-linux/reference/FunctionDeclaration.html
Normal file
140
arduino-0018-linux/reference/FunctionDeclaration.html
Normal file
|
@ -0,0 +1,140 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - FunctionDeclaration </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://www.arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://www.arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://www.arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://www.arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Board.html'>Board</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Functions</h2>
|
||||
<p>Segmenting code into functions allows a programmer to create modular pieces of code that perform a defined task and then return to the area of code from which the function was "called". The typical case for creating a function is when one needs to perform the same action multiple times in a program.
|
||||
</p>
|
||||
<p class='vspace'></p><p>For programmers accustomed to using BASIC, functions in Arduino provide (and extend) the utility of using subroutines (GOSUB in BASIC).
|
||||
</p>
|
||||
<p class='vspace'></p><p>Standardizing code fragments into functions has several advantages:
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li>Functions help the programmer stay organized. Often this helps to conceptualize the program.
|
||||
<p class='vspace'></p></li><li>Functions codify one action in one place so that the function only has to be thought out and debugged once.
|
||||
<p class='vspace'></p></li><li>This also reduces chances for errors in modification, if the code needs to be changed.
|
||||
<p class='vspace'></p></li><li>Functions make the whole sketch smaller and more compact because sections of code are reused many times.
|
||||
<p class='vspace'></p></li><li>They make it easier to reuse code in other programs by making it more modular, and as a nice side effect, using functions also often makes the code more readable.
|
||||
</li></ul><p class='vspace'></p><p>There are two required functions in an Arduino sketch, setup() and loop(). Other functions must be created outside the brackets of those two functions. As an example, we will create a simple function to multiply two numbers.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<div><img src='http://www.arduino.cc/en/uploads/Reference/FuncAnatomy.png' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p>To "call" our simple multiply function, we pass it parameters of the datatype that it is expecting:
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
void loop{
|
||||
int i = 2;
|
||||
int j = 3;
|
||||
int k;
|
||||
|
||||
k = myMultiplyFunction(i, j); // k now contains 6
|
||||
}
|
||||
|
||||
</pre><p>Our function needs to be <em>declared</em> outside any other function, so "myMultiplyFunction()" can go either above or below the "loop()" function.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The entire sketch would then look like this:
|
||||
</p><pre>void setup(){
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop{
|
||||
int i = 2;
|
||||
int j = 3;
|
||||
int k;
|
||||
|
||||
k = myMultiplyFunction(i, j); // k now contains 6
|
||||
Serial.println(k);
|
||||
delay(500);
|
||||
}
|
||||
|
||||
int myMultiplyFunction(int x, int y){
|
||||
int result;
|
||||
result = x * y;
|
||||
return result;
|
||||
}
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Another example </h4>
|
||||
<p>This function will read a sensor five times with analogRead() and calculate the average of five readings. It then scales the data to 8 bits (0-255), and inverts it, returning the inverted result.
|
||||
</p>
|
||||
<p class='vspace'></p><pre>int ReadSens_and_Condition(){
|
||||
int i;
|
||||
int sval;
|
||||
|
||||
for (i = 0; i < 5; i++){
|
||||
sval = sval + analogRead(0); // sensor on analog pin 0
|
||||
}
|
||||
|
||||
sval = sval / 5; // average
|
||||
sval = sval / 4; // scale to 8 bits (0 - 255)
|
||||
sval = 255 - sval; // invert output
|
||||
return sval;
|
||||
}
|
||||
</pre>
|
||||
<p class='vspace'></p><p>To call our function we just assign it to a variable.
|
||||
</p>
|
||||
<p class='vspace'></p><pre>int sens;
|
||||
|
||||
sens = ReadSens_and_Condition();
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://www.arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
93
arduino-0018-linux/reference/Goto.html
Normal file
93
arduino-0018-linux/reference/Goto.html
Normal file
|
@ -0,0 +1,93 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Goto </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>goto</h2>
|
||||
<p>Transfers program flow to a labeled point in the program
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>label:
|
||||
</p>
|
||||
<p class='vspace'></p><p>goto label; // sends program flow to the label
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Tip</h4>
|
||||
<p>The use of <em>goto</em> is discouraged in C programming, and some authors of C programming books claim that the <em>goto</em> statement is never necessary, but used judiciously, it can simplify certain programs. The reason that many programmers frown upon the use of <em>goto</em> is that with the unrestrained use of <em>goto</em> statements, it is easy to create a program with undefined program flow, which can never be debugged.
|
||||
</p>
|
||||
<p class='vspace'></p><p>With that said, there are instances where a goto statement can come in handy, and simplify coding. One of these situations is to break out of deeply nested <em>for</em> loops, or <em>if</em> logic blocks, on a certain condition.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
for(byte r = 0; r < 255; r++){
|
||||
for(byte g = 255; g > -1; g--){
|
||||
for(byte b = 0; b < 255; b++){
|
||||
if (analogRead(0) > 250){ goto bailout;}
|
||||
// more statements ...
|
||||
}
|
||||
}
|
||||
}
|
||||
bailout:
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
80
arduino-0018-linux/reference/Guide_ArduinoBT.html
Normal file
80
arduino-0018-linux/reference/Guide_ArduinoBT.html
Normal file
|
@ -0,0 +1,80 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ArduinoBT </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<h2><span class='wikiword'>ArduinoBT</span></h2>
|
||||
<p>The Arduino BT is an Arduino board with built-in bluetooth module, allowing for wireless communication. To get started with the Arduino BT, follow the directions for the Arduino NG on your operating system (<a class='wikilink' href='Guide_Windows.html'>Windows</a>, <a class='wikilink' href='Guide_MacOSX.html'>Mac OS X</a>, <a class='urllink' href='http://www.arduino.cc/playground/Learning/Linux' rel='nofollow'>Linux</a>), with the following modifications:
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li>First, pair the Arduino BT with your computer and create a virtual serial port for it. Look for a bluetooth device called <strong>ARDUINOBT</strong> and the pass code is <strong>12345</strong>.
|
||||
<p class='vspace'></p></li><li>Select <strong>Arduino BT</strong> from the <strong>Tools | Board</strong> menu of the Arduino environment.
|
||||
</li></ul><p class='vspace'></p><h3>Information about the Arduino BT</h3>
|
||||
<p>In most respects, the Arduino BT is similar to the Arduino Diecimila. Here are the main differences of BT board (besides the fact that it communicates over bluetooth instead of USB):
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li>The Arduino BT is more fragile and easy to break than a regular Arduino board.
|
||||
<p class='vspace'></p></li><li><strong>Don't power the board with more than 5.5 volts to the or reverse the polarity (power and ground pins) of your power supply, or you might kill the <span class='wikiword'>ATmega168</span> on the Arduino BT.</strong> The Arduino BT can, however, run with a minimum of 1.2 volts, making it easier to power with batteries.
|
||||
<p class='vspace'></p></li><li>The microcontroller (an <span class='wikiword'>ATmega168</span>) on the Arduino BT is a physically smaller version of the chip on the USB Arduino boards. You can't remove it, so if you kill it, you need a new Arduino BT.
|
||||
<p class='vspace'></p></li><li>There are two extra analog inputs on the Arduino BT (8 total). Two of these, however, are not connected to the pin headers on the board; you'll need to solder something to the pads next to the numbers "6" and "7".
|
||||
<p class='vspace'></p></li><li>Pin 7 is connected to the reset pin of the bluetooth module; <strong>don't use it for anything</strong> (except resetting the module).
|
||||
</li></ul><p class='vspace'></p><p>For more details, see the <a class='wikilink' href='http://arduino.cc/en/Main/ArduinoBoardBluetooth'>Arduino BT hardware page</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Using the Arduino BT</h3>
|
||||
<p>The on-board serial communication between the bluetooth module and the Arduino sketch (running on the <span class='wikiword'>ATmega168</span>) needs to be at 115200 baud (i.e. call Serial.begin(115200) in your setup() function). Communication between the bluetooth module and the computer can be at any baud rate.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Communication between the BT module and the computer can be temperamental. You might want to open the serial monitor a couple of seconds after resetting the board.
|
||||
The text of the Arduino getting started guide is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the guide are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_ArduinoBT?action=edit.html'>Edit Page</a> | <a href='Guide_ArduinoBT?action=diff.html'>Page History</a> | <a href='Guide_ArduinoBT?action=print.html' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,73 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ArduinoEthernetShield </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<h2>Arduino Ethernet Shield</h2>
|
||||
<p>The Arduino Ethernet shield allows an Arduino board to connect to the internet using the <a class='wikilink' href='Ethernet.html'>Ethernet library</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Connecting the Shield</h4>
|
||||
<div><img src='http://arduino.cc/en/uploads/Guide/ArduinoWithEthernetShield.jpg' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p>To use the shield, mount it on top of an Arduino board (e.g. the Diecimila). To upload sketches to the board, connect it to your computer with a USB cable as you normally would. Once the sketch has been uploaded, you can disconnect the board from your computer and power it with an external power supply.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Connect the shield to your computer or a network hub or router using a standard ethernet cable (<span class='wikiword'>CAT5</span> or <span class='wikiword'>CAT6</span> with <span class='wikiword'>RJ45</span> connectors). Connecting to a computer may require the use of a cross-over cable (although many computers, including <a class='urllink' href='http://support.apple.com/kb/HT2274' rel='nofollow'>all recent Macs</a> can do the cross-over internally).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Network Settings</h4>
|
||||
<p>The shield must be assigned a MAC address and a fixed IP address using the <a class='wikilink' href='EthernetBegin.html'>Ethernet.begin()</a> function. A MAC address is a globally unique identifier for a particular device; inventing a random one should work, but don't use the same one for multiple boards. Valid IP addresses depend on the configuration of your network. (It is possible to use DHCP to dynamically assign an IP to the shield, but this is not yet implemented.) Optionally, you can also specify a network gateway and subnet.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino getting started guide is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the guide are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_ArduinoEthernetShield?action=edit.html'>Edit Page</a> | <a href='Guide_ArduinoEthernetShield?action=diff.html'>Page History</a> | <a href='Guide_ArduinoEthernetShield?action=print.html' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
81
arduino-0018-linux/reference/Guide_ArduinoLilyPad.html
Normal file
81
arduino-0018-linux/reference/Guide_ArduinoLilyPad.html
Normal file
|
@ -0,0 +1,81 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ArduinoLilyPad </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<h2>Guide to the <span class='wikiword'>LilyPad</span> Arduino</h2>
|
||||
<p>To get started with the <span class='wikiword'>LilyPad</span> Arduino, follow the directions for the Arduino NG on your operating system (<a class='wikilink' href='Guide_Windows.html'>Windows</a>, <a class='wikilink' href='Guide_MacOSX.html'>Mac OS X</a>, <a class='urllink' href='http://www.arduino.cc/playground/Learning/Linux' rel='nofollow'>Linux</a>. Connecting the <span class='wikiword'>LilyPad</span> Arduino is a bit more complicated than a regular Arduino board (<a href='#connecting'>see below</a> for instructions and photos).
|
||||
</p>
|
||||
<p class='vspace'></p><p>The <span class='wikiword'>LilyPad</span> Arduino is more <strong>fragile and easy to break</strong> than a regular Arduino board. Don't connect more than 5.5 volts to the + tab or reverse the power and ground pins of your power supply, or you will very likely kill the <span class='wikiword'>ATmega</span> on the <span class='wikiword'>LilyPad</span> Arduino. You can't remove the <span class='wikiword'>ATmega</span>, so if you kill it, you need a new <span class='wikiword'>LilyPad</span>.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Note: More information about getting started with the <span class='wikiword'>LilyPad</span> Arduino can be found <a class='urllink' href='http://www.media.mit.edu/~leah/LilyPad' rel='nofollow'>here.</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a name='connecting' id='connecting'></a>
|
||||
</p><h3>Connecting the <span class='wikiword'>LilyPad</span> Arduino</h3>
|
||||
<p>To program the <span class='wikiword'>LilyPad</span> Arduino, you need to connect it to your computer. The <a class='urllink' href='http://www.sparkfun.com/commerce/product_info.php?products_id=8772' rel='nofollow'>SparkFun FTDI Basic Breakout</a> plugs into the 6-pin male header on the newest version of the <span class='wikiword'>LilyPad</span>. Use a USB <span class='wikiword'>MiniB</span> cable to connect the FTDI basic breakout to your computer. You can also use an <a class='urllink' href='http://www.ftdichip.com/Products/EvaluationKits/TTL-232R.htm' rel='nofollow'>FTDI USB-TTL Serial cable</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/lilypad_basicbreakout.jpg' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p>To connect earlier versions of the board or for information on other connection options see the <a class='urllink' href='http://www.media.mit.edu/~leah/LilyPad' rel='nofollow'>LilyPad Arduino tutorial</a> on Leah's website
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Sewing the <span class='wikiword'>LilyPad</span> Arduino</h3>
|
||||
<p>The hole on each tab of the <span class='wikiword'>LilyPad</span> is large enough for a sewing needle to pass through. You can make both electrical and physical connections with stitching in conductive thread. Sew through the holes several times to insure good contact. Here's a picture showing a sewn <span class='wikiword'>LilyPad</span>:
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/lilypad_sewn.jpg' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p>See the <a class='urllink' href='http://www.media.mit.edu/~leah/LilyPad' rel='nofollow'>LilyPad Arduino tutorial</a> on Leah's website for more information about building a working wearable. See <a class='urllink' href='http://www.sparkfun.com/commerce/categories.php?c=135' rel='nofollow'>SparkFun</a> for more stitchable modules that you can use with your <span class='wikiword'>LilyPad</span> Arduino.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino getting started guide is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the guide are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_ArduinoLilyPad?action=edit.html'>Edit Page</a> | <a href='Guide_ArduinoLilyPad?action=diff.html'>Page History</a> | <a href='Guide_ArduinoLilyPad?action=print.html' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
106
arduino-0018-linux/reference/Guide_ArduinoMini.html
Normal file
106
arduino-0018-linux/reference/Guide_ArduinoMini.html
Normal file
|
@ -0,0 +1,106 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ArduinoMini </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<h2>Guide to the Arduino Mini</h2>
|
||||
<p>To get started with the Arduino Mini, follow the directions for the regular Arduino on your operating system (<a class='wikilink' href='Guide_Windows.html'>Windows</a>, <a class='wikilink' href='Guide_MacOSX.html'>Mac OS X</a>, <a class='urllink' href='http://www.arduino.cc/playground/Learning/Linux' rel='nofollow'>Linux</a>), with the following modifications:
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li>Connecting the Arduino Mini is a bit more complicated than a regular Arduino board (<a href='#connecting'>see below</a> for instructions and photos).
|
||||
<p class='vspace'></p></li><li>You need to select <strong>Arduino Mini</strong> from the <strong>Tools | Board</strong> menu of the Arduino environment.
|
||||
<p class='vspace'></p></li><li>To upload a new sketch to the Arduino Mini, you need to press the reset button on the board immediately before pressing the upload button in the Arduino environment.
|
||||
</li></ul><p class='vspace'></p><h3>Information about the Arduino Mini</h3>
|
||||
<p>The microcontroller (an <span class='wikiword'>ATmega168</span>) on the Arduino Mini is a physically smaller version of the chip on the USB Arduino boards, with the following small difference:
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li>There are two extra analog inputs on the Mini (8 total). Four of these, however, are not connected to the legs that come on the Arduino Mini, requiring you to solder wires to their holes to use them. Two of these unconnected pins are also used by the Wire library (<span class='wikiword'>I2C</span>), meaning that its use will require soldering as well.
|
||||
</li></ul><p class='vspace'></p><p>Also, the Arduino Mini is more <strong>fragile and easy to break</strong> than a regular Arduino board.
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li>Don't connect more than 9 volts to the +9V pin or reverse the power and ground pins of your power supply, or you might kill the <span class='wikiword'>ATmega168</span> on the Arduino Mini.
|
||||
<p class='vspace'></p></li><li>You can't remove the <span class='wikiword'>ATmega168</span>, so if you kill it, you need a new Mini.
|
||||
</li></ul><p class='vspace'></p><p><a name='connecting' id='connecting'></a>
|
||||
</p><h3>Connecting the Arduino Mini</h3>
|
||||
<p>Here's a diagram of the pin layout of the Arduino Mini:
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
<table width='95%' border='0' cellpadding='5' cellspacing='0'><tr><td width='50%' valign='top'>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/arduino_mini_pinout.png' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p><em>Mini 03 pinout</em> (compatible with earlier revisions)
|
||||
</p>
|
||||
<p class='vspace'></p></td><td width='50%' valign='top'>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/arduino_mini04_pinout.png' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p><em>Mini 04 pinout</em> (the ground on the left has moved down one pin)
|
||||
</p>
|
||||
<p class='vspace'></p></td></tr></table>
|
||||
<p class='vspace'></p><p>To use the Arduino Mini, you need to connect:
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li>Power. This can be a regulated +5V power source (e.g. from the +5V pin of the Mini USB Adapter or an Arduino NG) connected to the +5V pin of the Arduino Mini. Or, a +9V power source (e.g. a 9 volt battery) connected to the +9V pin of the Arduino Mini.
|
||||
<p class='vspace'></p></li><li>Ground. One of the ground pins on the Arduino Mini must be connected to ground of the power source.
|
||||
<p class='vspace'></p></li><li>TX/RX. These pins are used both for uploading new sketches to the board and communicating with a computer or other device.
|
||||
<p class='vspace'></p></li><li>Reset. Whenever this pin is connected to ground, the Arduino Mini resets. You can wire it to a pushbutton, or connect it to +5V to prevent the Arduino Mini from resetting (except when it loses power). If you leave the reset pin unconnected, the Arduino Mini will reset randomly.
|
||||
<p class='vspace'></p></li><li>An LED. While not technically necessary, connecting an LED to the Arduino Mini makes it easier to check if it's working. Pin 13 has a 1 KB resistor on it, so you can connect an LED to it directly between it and ground. When using another pin, you will need an external resistor.
|
||||
</li></ul><p class='vspace'></p><p>You have a few options for connecting the board: the Mini USB Adapter, a regular Arduino board, or your own power supply and USB/Serial adapter.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Connecting the Arduino Mini and Mini USB Adapter</h4>
|
||||
<p>Here is a photo showing the Arduino Mini connected to the Mini USB adapter. Notice that the reset pin is connected directly to +5V (the orange wire), without a pushbutton. Thus, to reset the Arduino Mini, you will need to unplug and reconnect the USB cable to the Mini USB Adapter, or manually move the orange wire connected to the reset pin from +5V to ground and back.
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/ArduinoMiniBreadboardPhoto.jpg' alt='' title='' /></div>
|
||||
<p class='vspace'></p><h4>Connecting the Arduino Mini and a regular Arduino</h4>
|
||||
<p>Here's a photo of the Arduino Mini connected to an Arduino NG. The NG has its <span class='wikiword'>ATmega8</span> removed and is being used for its USB connection, power source, and reset button. Thus, you can reset the Arduino Mini just by pressing the button on the NG.
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/ArduinoMiniAndNGBreadboardPhoto.jpg' alt='' title='' /></div>
|
||||
<p>The text of the Arduino getting started guide is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the guide are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_ArduinoMini?action=edit.html'>Edit Page</a> | <a href='Guide_ArduinoMini?action=diff.html'>Page History</a> | <a href='Guide_ArduinoMini?action=print.html' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
73
arduino-0018-linux/reference/Guide_ArduinoNano.html
Normal file
73
arduino-0018-linux/reference/Guide_ArduinoNano.html
Normal file
|
@ -0,0 +1,73 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ArduinoNano </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<h2>Guide to the Arduino Nano</h2>
|
||||
<div><img src='http://arduino.cc/en/uploads/Guide/ArduinoNanoUSBCable.jpg' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p><em>Connecting the Arduino Nano 2.2 to a computer with a Mini-B USB cable. Note the blue power LED underneath the board.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p><br clear='all' />
|
||||
</p>
|
||||
<p class='vspace'></p><p>To connect the Arduino Nano to your computer, you'll need a Mini-B USB cable. This also provides power to the board, as indicated by the blue LED (which is on the bottom of the Arduino Nano 2.x and the top of the Arduino Nano 3.0).
|
||||
</p>
|
||||
<p class='vspace'></p><p>If you have an Arduino Nano 3.0, you'll need to select <strong>Arduino Duemilanove or Nano w/ <span class='wikiword'>ATmega32</span></strong> from the <strong>Tools > Board</strong> menu. If you have an Arduino Nano 2.x, select <strong>Arduino Diecimila, Duemilanove, or Nano w/ <span class='wikiword'>ATmega168</span></strong>. Select the correct serial port selected from the <strong>Tools > Serial Port</strong> menu. Then simply press the upload button in the Arduino environment. The board will automatically reset and the sketch will be uploaded. If you have any problems, see the <a class='wikilink' href='Guide_Troubleshooting#upload.html'>troubleshooting guide</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><p>For more details on the Arduino Nano, see the <a class='wikilink' href='http://arduino.cc/en/Main/ArduinoBoardNano'>hardware page</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino getting started guide is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the guide are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_ArduinoNano?action=edit.html'>Edit Page</a> | <a href='Guide_ArduinoNano?action=diff.html'>Page History</a> | <a href='Guide_ArduinoNano?action=print.html' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
96
arduino-0018-linux/reference/Guide_ArduinoPro.html
Normal file
96
arduino-0018-linux/reference/Guide_ArduinoPro.html
Normal file
|
@ -0,0 +1,96 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ArduinoPro </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<h2>Arduino Pro</h2>
|
||||
<p>The Arduino Pro is intended for advanced users who require flexibility and low-cost. It comes with the minimum of components (no on-board USB or pin headers) to keep the cost down. It's a good choice for a board you want to leave embedded in a project. Please note that there are multiple variants of the board which operate at different voltages and clock speeds. You need to know if you have the 3.3V / 8 <span class='wikiword'>MHz</span> version or the 5V / 16 <span class='wikiword'>MHz</span> version.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Uploading Sketches</h3>
|
||||
<p>The board comes without built-in USB circuitry, so an off-board USB-to-TTL serial convertor must be used to upload sketches. For the 3.3V Arduino Pro boards, this can be a <a class='urllink' href='http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm' rel='nofollow'>FTDI TTL-232R-3V3 USB - TTL Level Serial Converter Cable</a> or the <span class='wikiword'>SparkFun</span> <a class='urllink' href='http://www.sparkfun.com/commerce/product_info.php?products_id=8772' rel='nofollow'>FTDI Basic Breakout Board (3.3V)</a>. For the 5V Arduino Pro boards, use a <a class='urllink' href='http://www.ftdichip.com/Products/EvaluationKits/TTL-232R.htm' rel='nofollow'>TTL-232R USB - TTL Level Serial Converter</a> or the <span class='wikiword'>SparkFun</span> <a class='urllink' href='http://www.sparkfun.com/commerce/product_info.php?products_id=9115' rel='nofollow'>FTDI Basic Breakout Board (5V)</a>. (You can probably also get away with using a 5V USB-to-serial convertor with a 3.3V board and vice-versa, but it's not recommended.)
|
||||
</p>
|
||||
<p class='vspace'></p><p>If using the FTDI cable on Windows, you'll need to make one configuration change to enable the auto-reset. With the board connected, open the Device Manager (in Control Panels > System > Hardware), and find the USB Serial Port under Ports. Right-click and select properties, then go to Port Settings > Advanced and check Set RTS on Close under Miscellaneous Options.
|
||||
</p>
|
||||
<p class='vspace'></p><p>For the 3.3V versions of the Arduino Pro, select <strong>Arduino Pro or Pro Mini (3.3V, 8 <span class='wikiword'>MHz</span>) w/ <span class='wikiword'>ATmega328</span></strong> or <strong>Arduino Pro or Pro Mini (3.3V, 8 <span class='wikiword'>MHz</span>) w/ <span class='wikiword'>ATmega168</span></strong> from the <strong>Tools > Board</strong> menu (depending on the microcontroller on your board). For the 5V versions of the Arduino Pro, select <strong>Arduino Duemilanove or Nano w/ <span class='wikiword'>ATmega328</span></strong> or <strong>Arduino Diecimila, Duemilanove, or Nano w/ <span class='wikiword'>ATmega168</span></strong>.
|
||||
</p>
|
||||
<p class='vspace'></p><p><br clear='all' />
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/ArduinoProFTDICable.jpg' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p><em>An Arduino Pro connected to (and powered by) an FTDI USB - TTL Level Serial Converter Cable. The green and yellow wires align with the words "green" and "yellow" written underneath the pins.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p><br clear='all' />
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/ArduinoProFTDIBreakout.jpg' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p><em>The Arduino Pro connected to (and powered by) a <span class='wikiword'>SparkFun</span> FTDI Basic Breakout Board (prototype version) and USB Mini-B cable.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p><br clear='all' />
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Power</h3>
|
||||
<p>The external USB-to-TTL serial convertor will power the Arduino Pro, regardless of the position of the switch. To use the board standalone, with no connection to a computer, it can be be powered by a battery or an external power supply (wall wart). You can solder the + and - wires of a battery connector to the corresponding holes on the board. For the 3.3V boards, you can connect a <span class='wikiword'>LiPo</span> battery (with JST connector) to the JST jack. Alternatively, solder a DC power jack into the three large holes on the board, and connect a DC power supply (center positive). When the switch is in the "Batt" position, the board will draw power from an attached battery; when it is in the "Ext." position, power comes from an external power supply. In either position, the board can be powered by the 6-pin USB header.
|
||||
</p>
|
||||
<p class='vspace'></p><p><br clear='all' />
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/ArduinoProBattery.jpg' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p><em>A 3.3V Arduino Pro powered by a <a class='urllink' href='https://www.sparkfun.com/commerce/product_info.php?products_id=8483' rel='nofollow'>2000 mAh LiPo battery</a> from <span class='wikiword'>SparkFun</span>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p><br clear='all' />
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Connectors</h3>
|
||||
<p>Any standard 0.1" spaced header can be soldered to the holes on the Arduino Pro. To use every pin requires two 6-pin header and two 8-pin headers. Bare wire can also be soldered directly to the holes. Note that the header spacing is compatible with Arduino shields.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino getting started guide is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the guide are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_ArduinoPro?action=edit.html'>Edit Page</a> | <a href='Guide_ArduinoPro?action=diff.html'>Page History</a> | <a href='Guide_ArduinoPro?action=print.html' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
90
arduino-0018-linux/reference/Guide_ArduinoProMini.html
Normal file
90
arduino-0018-linux/reference/Guide_ArduinoProMini.html
Normal file
|
@ -0,0 +1,90 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ArduinoProMini </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<h2>Arduino Pro Mini</h2>
|
||||
<p>The Arduino Pro Mini is intended for advanced users who require flexibility, low-cost, and small size. It comes with the minimum of components (no on-board USB or pin headers) to keep the cost down. It's a good choice for a board you want to leave embedded in a project. Please note that there are two versions of the board: one that operates at 5V (like most Arduino boards), and one that operates at 3.3V. Be sure to provide the correct power and use components whose operating voltage matches that of the board.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Uploading Sketches</h3>
|
||||
<p>The board comes without built-in USB circuitry, so an off-board USB-to-TTL serial convertor must be used to upload sketches. This can be a <a class='urllink' href='http://www.ftdichip.com/Products/EvaluationKits/TTL-232R.htm' rel='nofollow'>FTDI TTL-232R USB - TTL Level Serial Converter Cable</a> for the 5V Arduino Mini Pro), or a <a class='urllink' href='http://www.ftdichip.com/Products/EvaluationKits/TTL-232R-3V3.htm' rel='nofollow'>FTDI TTL-232R-3V3 USB - TTL Level Serial Converter Cable</a> or the <span class='wikiword'>SparkFun</span> <a class='urllink' href='http://www.sparkfun.com/commerce/product_info.php?products_id=8772' rel='nofollow'>FTDI Basic Breakout Board</a> for a 3.3V Arduino Mini Pro.
|
||||
One convenient way to connect these is by inserting a six-pin 0.1" male pin header into the end of the FTDI cable or breakout board, and pressing it against the six hole programming header on the Mini Pro.
|
||||
</p>
|
||||
<p class='vspace'></p><p>If using the FTDI cable on Windows, you'll need to make one configuration change to enable the auto-reset. With the board connected, open the Device Manager (in Control Panels > System > Hardware), and find the USB Serial Port under Ports. Right-click and select properties, then go to Port Settings > Advanced and check Set RTS on Close under Miscellaneous Options.
|
||||
</p>
|
||||
<p class='vspace'></p><p>For the 3.3V versions of the Arduino Pro Mini, select <strong>Arduino Pro or Pro Mini (3.3V, 8 <span class='wikiword'>MHz</span>) w/ <span class='wikiword'>ATmega328</span></strong> or <strong>Arduino Pro or Pro Mini (3.3V, 8 <span class='wikiword'>MHz</span>) w/ <span class='wikiword'>ATmega168</span></strong> from the <strong>Tools > Board</strong> menu (depending on the microcontroller on your board). For the 5V versions of the Arduino Pro Mini, select <strong>Arduino Duemilanove or Nano w/ <span class='wikiword'>ATmega328</span></strong> or <strong>Arduino Diecimila, Duemilanove, or Nano w/ <span class='wikiword'>ATmega168</span></strong>.
|
||||
</p>
|
||||
<p class='vspace'></p><p><br clear='all' />
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/ArduinoProMiniFTDICable.jpg' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p><em>The Arduino Pro Mini connected to (and powered by) an FTDI TTL-232R-3V3 USB - TTL Level Serial Converter Cable. The green and black wires align with the labels "GRN" and "BLK" written next to the holes.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p><br clear='all' />
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/ArduinoProMiniFTDIBreakout2.jpg' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p><em>The Arduino Pro Mini connected to (and powered by) a <span class='wikiword'>SparkFun</span> FTDI Basic Breakout Board and USB Mini-B cable. Note that on earlier Pro Mini boards the orientation of the 6-pin header may be reversed; check that the words GRN and BLK align on the Pro Mini and FTDI Basic Breakout.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p><br clear='all' />
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Power</h3>
|
||||
<p>The board can be powered through USB via the six-pin programming header, or from a regulated 5V or 3.3V (depending on the model) supply applied to the VCC pin or an unregulated supply on the RAW pin.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Connectors</h3>
|
||||
<p>Any standard 0.1" spaced header can be soldered to the holes on the Arduino Pro Mini. To use every pin requires two 12-pin headers, plus a six pin header for programming, if desired. Bare wire can also be soldered directly to the holes.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino getting started guide is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the guide are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_ArduinoProMini?action=edit.html'>Edit Page</a> | <a href='Guide_ArduinoProMini?action=diff.html'>Page History</a> | <a href='Guide_ArduinoProMini?action=print.html' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
150
arduino-0018-linux/reference/Guide_ArduinoXbeeShield.html
Normal file
150
arduino-0018-linux/reference/Guide_ArduinoXbeeShield.html
Normal file
|
@ -0,0 +1,150 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - ArduinoXbeeShield </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<h2>Arduino <span class='wikiword'>XBee</span> Shield</h2>
|
||||
<p>The Arduino Xbee shield allows your Arduino board to communicate wirelessly using Zigbee. It was developed in collaboration with <a class='urllink' href='http://www.libelium.com/' rel='nofollow'>Libelium</a>. This documentation describes the use of the shield with the <span class='wikiword'>XBee</span> 802.15.4 module. For the <span class='wikiword'>XBee</span> <span class='wikiword'>ZNet</span> 2.5 ("Series 2") modules, see <a class='urllink' href='http://www.humboldt.edu/~cm19/XBee%20setup.pdf' rel='nofollow'>this configuration guide</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>A Simple Example</h3>
|
||||
<p>You should be able to get two Arduino boards with Xbee shields talking to each other without any configuration, using just the standard Arduino serial commands (described in the <a class='wikilink' href='index.html'>reference</a>).
|
||||
</p>
|
||||
<p class='vspace'></p><p>To upload a sketch to an Arduino board with a Xbee shield, you'll need to put both jumpers on the shield to the "USB" setting (i.e. place them on the two pins closest to the edge of the board) or remove them completely (but be sure not to lose them!). Then, you can upload a sketch normally from the Arduino environment. In this case, upload the <strong>Communication | Physical Pixel</strong> sketch to one of the boards. This sketch instructs the board to turn on the LED attached to pin 13 whenever it receives an 'H' over its serial connection, and turn the LED off when it gets an 'L'. You can test it by connecting to the board with the Arduino serial monitor (be sure it's set at 9600 baud), typing an H, and pressing enter (or clicking send). The LED should turn on. Send an L and the LED should turn off. If nothing happens, you may have an Arduino board that doesn't have a built-in LED on pin 13 (see the <a class='wikilink' href='http://arduino.cc/en/Main/Boards'>board index</a> to check for sure), in this case you'll need to supply your own.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Once you've uploaded the Physical Pixel sketch and made sure that it's working, unplug the first Arduino board from the computer. Switch the jumpers to the Xbee setting (i.e. place each on the center pin and the pin farthest from the edge of the board). Now, you need to upload a sketch to the other board. Make sure its jumpers are in the USB setting. Then upload the following sketch to the board:
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
void setup()
|
||||
{
|
||||
Serial.begin(9600);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
Serial.print('H');
|
||||
delay(1000);
|
||||
Serial.print('L');
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p>When it's finished uploading, you can check that it's working with the Arduino serial monitor. You should see H's and L's arriving one a second. Turn off the serial monitor and unplug the board. Switch the jumpers to the Xbee setting. Now connect both boards to the computer. After a few seconds, you should see the LED on the first board turn on and off, once a second. (This is the LED on the Arduino board itself, not the one on the Xbee shield, which conveys information about the state of the Xbee module.) If so, congratulations, your Arduino boards are communicating wirelessly. This may not seem that exciting when both boards are connected to the same computer, but if you connect them to different computers (or power them with an external power supply - being sure to switch the power jumper on the Arduino board), they should still be able to communicate.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>A Few Notes</h3>
|
||||
<p>You can use any of the standard Arduino serial commands with the Xbee shield. With the shield's jumpers in the Xbee position, the print and println commands will send data over the Xbee shield and the USB connection (i.e. to other Xbee shields and to the computer at the same time). In this configuration, however, the board will only receive data from the Xbee shield not from the USB connection (you'll need to switch the jumpers to allow the board to receive data from the computer).
|
||||
</p>
|
||||
<p class='vspace'></p><p>The Xbee module on the shield is set up to work at 9600 baud by default, so unless you reconfigure it, you'll need to make sure you're passing 9600 to the Serial.begin() command in your sketch.
|
||||
</p>
|
||||
<p class='vspace'></p><p>To allow your computer to communicate directly with the Xbee shield, connect it to an Arduino board whose microcontroller has been removed and place its jumpers in the USB configuration. Then you can send data to and receive data from the Xbee module from any terminal program. This allows you, for example, to see the data that the module is receiving from other Xbee shields (e.g. to collect sensor data wirelessly from a number of locations).
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Configuring the Xbee Module</h3>
|
||||
<p>You can configure the Xbee module from code running on the Arduino board or from software on the computer. To configure it from the Arduino board, you'll need to have the jumpers in the Xbee position. To configure it from the computer, you'll need to have the jumpers in the USB configuration and have removed the microncontroller from your Arduino board.
|
||||
</p>
|
||||
<p class='vspace'></p><p>To get the module into configuration mode, you need to send it three plus signs: +++ and there needs to be at least one second before and after during which you send no other character to the module. Note that this includes newlines or carriage return characters. Thus, if you're trying to configure the module from the computer, you need to make sure your terminal software is configured to send characters as you type them, without waiting for you to press enter. Otherwise, it will send the plus signs immediately followed by a newline (i.e. you won't get the needed one second delay after the +++). If you successfully enter configuration mode, the module will send back the two characters 'OK', followed by a carriage return.
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
<table width="60%"><tr><td width="50%" valign='top'> Send Command
|
||||
</td><td width="50%" valign='top'> Expected Response
|
||||
</td></tr><tr><td valign='top'> <code>+++</code>
|
||||
</td><td valign='top'> <code>OK</code><em><CR></em>
|
||||
</td></tr></table>
|
||||
<p class='vspace'></p><p>Once in configuration mode, you can send AT commands to the module. Command strings have the form <span class='wikiword'>ATxx</span> (where xx is the name of a setting). To read the current value of the setting, send the command string followed by a carriage return. To write a new value to the setting, send the command string, immediately followed by the new setting (with no spaces or newlines in-between), followed by a carriage return. For example, to read the network ID of the module (which determines which other Xbee modules it will communicate with), use the <em>'ATID</em> command:
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
<table width="60%"><tr><td width="50%" valign='top'> Send Command
|
||||
</td><td width="50%" valign='top'> Expected Response
|
||||
</td></tr><tr><td valign='top'> <code>ATID</code><em><enter></em>
|
||||
</td><td valign='top'> <code>3332</code><em><CR></em>
|
||||
</td></tr></table>
|
||||
<p class='vspace'></p><p>To change the network ID of the module:
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
<table width="60%"><tr><td width="50%" valign='top'> Send Command
|
||||
</td><td width="50%" valign='top'> Expected Response
|
||||
</td></tr><tr><td valign='top'> <code><span class='wikiword'>ATID3331</span></code><em><enter></em>
|
||||
</td><td valign='top'> <code>OK</code><em><CR></em>
|
||||
</td></tr></table>
|
||||
<p class='vspace'></p><p>Now, check that the setting has taken effect:
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
<table width="60%"><tr><td width="50%" valign='top'> Send Command
|
||||
</td><td width="50%" valign='top'> Expected Response
|
||||
</td></tr><tr><td valign='top'> <code>ATID</code><em><enter></em>
|
||||
</td><td valign='top'> <code>3331</code><em><CR></em>
|
||||
</td></tr></table>
|
||||
<p class='vspace'></p><p>Unless you tell the module to write the changes to non-volatile (long-term) memory, they will only be in effect until the module loses power. To save the changes permanently (until you explicitly modify them again), use the <strong>ATWR</strong> command:
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
<table width="60%"><tr><td width="50%" valign='top'> Send Command
|
||||
</td><td width="50%" valign='top'> Expected Response
|
||||
</td></tr><tr><td valign='top'> <code>ATWR</code><em><enter></em>
|
||||
</td><td valign='top'> <code>OK</code><em><CR></em>
|
||||
</td></tr></table>
|
||||
<p class='vspace'></p><p>To reset the module to the factory settings, use the <strong>ATRE</strong> command:
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
<table width="60%"><tr><td width="50%" valign='top'> Send Command
|
||||
</td><td width="50%" valign='top'> Expected Response
|
||||
</td></tr><tr><td valign='top'> <code>ATRE</code><em><enter></em>
|
||||
</td><td valign='top'> <code>OK</code><em><CR></em>
|
||||
</td></tr></table>
|
||||
<p class='vspace'></p><p>Note that like the other commands, the reset will not be permanent unless you follow it with the <strong>ATWR</strong> comamand.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>References</h3>
|
||||
<p>For more information, see: the <a class='wikilink' href='http://arduino.cc/en/Main/ArduinoXbeeShield'>hardware page</a> for the Xbee shield, the <a class='urllink' href='http://www.squidbee.org/' rel='nofollow'>Libelium SquidBee wiki</a>, and the <a class='urllink' href='http://www.maxstream.net/products/xbee/xbee-oem-rf-module-zigbee.php' rel='nofollow'>MaxStream Xbee page</a>.
|
||||
The text of the Arduino getting started guide is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the guide are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_ArduinoXbeeShield?action=edit.html'>Edit Page</a> | <a href='Guide_ArduinoXbeeShield?action=diff.html'>Page History</a> | <a href='Guide_ArduinoXbeeShield?action=print.html' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
82
arduino-0018-linux/reference/Guide_Board.html
Normal file
82
arduino-0018-linux/reference/Guide_Board.html
Normal file
|
@ -0,0 +1,82 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Board </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav">
|
||||
<p><a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Tutorial/HomePage'>Tutorials</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Software'>Software</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/blog/' rel='nofollow'>Blog</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl' rel='nofollow'>Forum</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/playground/' rel='nofollow'>Playground</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/playground/Projects/ArduinoUsers' rel='nofollow'>Exhibition</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Hacking/HomePage'>Hacking</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Buy'>Buy</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Guide</strong> <a class='wikilink' href='Guide_index.html'>Contents</a> | <a class='wikilink' href='Guide_Introduction.html'>Introduction</a> | How To: <a class='wikilink' href='Guide_Windows.html'>Windows</a>, <a class='wikilink' href='Guide_MacOSX.html'>Mac OS X</a>, <a class='urllink' href='http://www.arduino.cc/playground/Learning/Linux' rel='nofollow'>Linux</a>; <a class='wikilink' href='Guide_ArduinoMini.html'>Arduino Mini</a>, <a class='wikilink' href='Guide_ArduinoBT.html'>Arduino BT</a>, <a class='wikilink' href='Guide_ArduinoLilyPad.html'>LilyPad Arduino</a>; <a class='wikilink' href='Guide_ArduinoXbeeShield.html'>Xbee shield</a> | <a class='wikilink' href='Guide_Troubleshooting.html'>Troubleshooting</a> | <a class='selflink' href='Guide_Board.html'>Board</a> | <a class='wikilink' href='Guide_Environment.html'>Environment</a>
|
||||
</p><h2>Introduction to the Arduino Board</h2>
|
||||
<p>Looking at the board from the top down, this is an outline of what you will see (parts of the board you might interact with in the course of normal use are highlighted):
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://www.arduino.cc/en/uploads/Guide/arduino_board.png' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p>Starting clockwise from the top center:
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li>Analog Reference pin (orange)
|
||||
</li><li>Digital Ground (light green)
|
||||
</li><li>Digital Pins 2-13 (green)
|
||||
</li><li>Digital Pins 0-1/Serial In/Out - TX/RX (dark green) - <em>These pins cannot be used for digital i/o (<strong>digitalRead</strong> and <strong>digitalWrite</strong>) if you are also using serial communication (e.g. <strong>Serial.begin</strong>)</em>.
|
||||
</li><li>Reset Button - S1 (dark blue)
|
||||
</li><li>In-circuit Serial Programmer (blue-green)
|
||||
</li><li>Analog In Pins 0-5 (light blue)
|
||||
</li><li>Power and Ground Pins (power: orange, grounds: light orange)
|
||||
</li><li>External Power Supply In (9-12VDC) - X1 (pink)
|
||||
</li><li>Toggles External Power and USB Power (place jumper on two pins closest to desired supply) - <span class='wikiword'>SV1</span> (purple)
|
||||
</li><li>USB (used for uploading sketches to the board and for serial communication between the board and the computer; can be used to power the board) (yellow)
|
||||
</li></ul><p class='vspace'></p><p>The text of the Arduino getting started guide is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the guide are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_Board?action=edit.html'>Edit Page</a> | <a href='Guide_Board?action=diff.html'>Page History</a> | <a href='Guide_Board?action=print.html' target='_blank'>Printable View</a> | <a href='http://www.arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
166
arduino-0018-linux/reference/Guide_Environment.html
Normal file
166
arduino-0018-linux/reference/Guide_Environment.html
Normal file
|
@ -0,0 +1,166 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Environment </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<h2>Arduino Development Environment</h2>
|
||||
<p>The Arduino development environment contains a text editor for writing code, a message area, a text console, a toolbar with buttons for common functions, and a series of menus. It connects to the Arduino hardware to upload programs and communicate with them.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Software written using Arduino are called sketches. These sketches are written in the text editor. It has features for cutting/pasting and for searching/replacing text. The message area gives feedback while saving and exporting and also displays errors. The console displays text output by the Arduino environment including complete error messages and other information. The toolbar buttons allow you to verify and upload programs, create, open, and save sketches, and open the serial monitor:
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
<p class='vspace'></p><table width='100%'><tr><td width='40' valign='top'>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/play.gif' alt='' title='' /></div>
|
||||
<p class='vspace'></p></td><td valign='top'>
|
||||
<p class='vspace'></p><p><em>Verify/Compile</em> <br clear='all' /> Checks your code for errors.
|
||||
</p>
|
||||
<p class='vspace'></p></td></tr><tr><td valign='top'>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/stop.gif' alt='' title='' /></div>
|
||||
<p class='vspace'></p></td><td valign='top'>
|
||||
<p class='vspace'></p><p><em>Stop</em> <br clear='all' /> Stops the serial monitor, or unhighlight other buttons.
|
||||
</p>
|
||||
<p class='vspace'></p></td></tr><tr><td valign='top'>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/new.gif' alt='' title='' /></div>
|
||||
<p class='vspace'></p></td><td valign='top'>
|
||||
<p class='vspace'></p><p><em>New</em> <br clear='all' /> Creates a new sketch.
|
||||
</p>
|
||||
<p class='vspace'></p></td></tr><tr><td valign='top'>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/open.gif' alt='' title='' /></div>
|
||||
<p class='vspace'></p></td><td valign='top'>
|
||||
<p class='vspace'></p><p><em>Open</em> <br clear='all' /> Presents a menu of all the sketches in your sketchbook. Clicking one will open it within the current window.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Note: due to a bug in Java, this menu doesn't scroll; if you need to open a sketch late in the list, use the <strong>File | Sketchbook</strong> menu instead.
|
||||
</p>
|
||||
<p class='vspace'></p></td></tr><tr><td valign='top'>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/save.gif' alt='' title='' /></div>
|
||||
<p class='vspace'></p></td><td valign='top'>
|
||||
<p class='vspace'></p><p><em>Save</em> <br clear='all' /> Saves your sketch.
|
||||
</p>
|
||||
<p class='vspace'></p></td></tr><tr><td valign='top'>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/export.gif' alt='' title='' /></div>
|
||||
<p class='vspace'></p></td><td valign='top'>
|
||||
<p class='vspace'></p><p><em>Upload to I/O Board</em> <br clear='all' /> Compiles your code and uploads it to the Arduino I/O board. See <a href='#uploading'>uploading</a> below for details.
|
||||
</p>
|
||||
<p class='vspace'></p></td></tr><tr><td valign='top'>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/serial_monitor.gif' alt='' title='' /></div>
|
||||
<p class='vspace'></p></td><td valign='top'>
|
||||
<p class='vspace'></p><p><em>Serial Monitor</em> <br clear='all' /> Opens the <a href='#serialmonitor'>serial monitor</a>.
|
||||
</p>
|
||||
<p class='vspace'></p></td></tr></table>
|
||||
<p class='vspace'></p><p>Additional commands are found within the five menus: File, Edit, Sketch, Tools, Help. The menus are context sensitive which means only those items relevant to the work currently being carried out are available.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Edit</h4>
|
||||
<ul><li><em>Copy for Discourse</em> <br clear='all' /> Copies the code of your sketch to the clipboard in a forum suitable for posting to the forum, complete with syntax coloring.
|
||||
<p class='vspace'></p></li><li><em>Copy as HTML</em> <br clear='all' /> Copies the code of your sketch to the clipboard as HTML, suitable for embedding in web pages.
|
||||
</li></ul><p class='vspace'></p><h4>Sketch</h4>
|
||||
<ul><li><em>Verify/Compile</em> <br clear='all' /> Checks your sketch for errors.
|
||||
<p class='vspace'></p></li><li><em>Import Library</em> <br clear='all' /> Adds a library to your sketch by inserting #include statements at the code of your code. For more details, see <a href='#libraries'>libraries</a> below.
|
||||
<p class='vspace'></p></li><li><em>Show Sketch Folder</em> <br clear='all' /> Opens the sketch folder on the desktop.
|
||||
<p class='vspace'></p></li><li><em>Add File...</em> <br clear='all' /> Adds a source file to the sketch (it will be copied from its current location). The new file appears in a new tab in the sketch window. Files can be removed from the sketch using the tab menu.
|
||||
</li></ul><p class='vspace'></p><h4>Tools</h4>
|
||||
<ul><li><em>Auto Format</em> <br clear='all' /> This formats your code nicely: i.e. indents it so that opening and closing curly braces line up, and that the statements instead curly braces are indented more.
|
||||
<p class='vspace'></p></li><li><em>Board</em> <br clear='all' /> Select the board that you're using. See below for <a href='#boards'>descriptions of the various boards</a>.
|
||||
<p class='vspace'></p></li><li><em>Serial Port</em> <br clear='all' /> This menu contains all the serial devices (real or virtual) on your machine. It should automatically refresh every time you open the top-level tools menu.
|
||||
<p class='vspace'></p></li><li><em>Burn Bootloader</em> <br clear='all' /> The items in this menu allow you to burn a <a class='wikilink' href='http://arduino.cc/en/Tutorial/Bootloader'>bootloader</a> onto the microcontroller on an Arduino board. This is not required for normal use of an Arduino board but is useful if you purchase a new <span class='wikiword'>ATmega</span> (which normally come without a bootloader). Ensure that you've selected the correct board from the <strong>Boards</strong> menu before burning the bootloader. When using an AVR ISP, you'll need to select the item corresponding to your programmer from the <strong>Serial Port</strong> menu.
|
||||
</li></ul><p class='vspace'></p><p><a name='sketchbook' id='sketchbook'></a>
|
||||
</p><h3>Sketchbook</h3>
|
||||
<p>The Arduino environment includes the concept of a sketchbook: a standard place to store your programs (or sketches). The sketches in your sketchbook can be opened from the <strong>File > Sketchbook</strong> menu or from the <strong>Open</strong> button on the toolbar. The first time you run the Arduino software, it will automatically create a directory for your sketchbook. You can view or change the location of the sketchbook location from with the <strong>Preferences</strong> dialog.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Tabs, Multiple Files, and Compilation</h3>
|
||||
<p>Allows you to manage sketches with more than one file (each of which appears in its own tab). These can be normal Arduino code files (no extension), C files (.c extension), C++ files (.cpp), or header files (.h).
|
||||
</p>
|
||||
<p class='vspace'></p><p><a name='uploading' id='uploading'></a>
|
||||
</p><h3>Uploading</h3>
|
||||
<p>Before uploading your sketch, you need to select the correct items from the <strong>Tools > Board</strong> and <strong>Tools > Serial Port</strong> menus. The <a href='#boards'>boards</a> are described below. On the Mac, the serial port is probably something like <strong>/dev/tty.usbserial-1B1</strong> (for a USB board), or <strong>/dev/<span class='wikiword'>tty.USA19QW1b1P1</span>.1</strong> (for a serial board connected with a Keyspan USB-to-Serial adapter). On Windows, it's probably <strong><span class='wikiword'>COM1</span></strong> or <strong><span class='wikiword'>COM2</span></strong> (for a serial board) or <strong><span class='wikiword'>COM4</span></strong>, <strong><span class='wikiword'>COM5</span></strong>, <strong><span class='wikiword'>COM7</span></strong>, or higher (for a USB board) - to find out, you look for USB serial device in the ports section of the Windows Device Manager. On Linux, it should be <strong>/dev/ttyUSB0</strong>, <strong>/dev/ttyUSB1</strong> or similar.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Once you've selected the correct serial port and board, press the upload button in the toolbar or select the <strong>Upload to I/O Board</strong> item from the <strong>File</strong> menu. Current Arduino boards will reset automatically and begin the upload. With older boards that lack auto-reset, you'll need to press the reset button on the board just before starting the upload. On most boards, you'll see the RX and TX <span class='wikiword'>LEDs</span> blink as the sketch is uploaded. The Arduino environment will display a message when the upload is complete, or show an error.
|
||||
</p>
|
||||
<p class='vspace'></p><p>When you upload a sketch, you're using the Arduino bootloader, a small program that has been loaded on to the microcontroller on your board. It allows you to upload code without using any additional hardware. The bootloader is active for a few seconds when the board resets; then it starts whichever sketch was most recently uploaded to the microcontroller. The bootloader will blink the on-board (pin 13) LED when it starts (i.e. when the board resets).
|
||||
</p>
|
||||
<p class='vspace'></p><p><a name='libraries' id='libraries'></a>
|
||||
</p><h3>Libraries</h3>
|
||||
<p>Libraries provide extra functionality for use in sketches, e.g. working with hardware or manipulating data. To use a library in a sketch, select it from the <strong>Sketch > Import Library</strong> menu. This will insert one or more <strong>#include</strong> statements at the top of the sketch and compile the library with your sketch. Because libraries are uploaded to the board with your sketch, they increase the amount of space it takes up. If a sketch no longer needs a library, simply delete its <strong>#include</strong> statements from the top of your code.
|
||||
</p>
|
||||
<p class='vspace'></p><p>There is a <a class='wikilink' href='Libraries.html'>list of libraries</a> in the reference. Some libraries are included with the Arduino software. Others can be downloaded from a variety of sources. To install these third-party libraries, create a directory called <strong>libraries</strong> within your <a href='#sketchbook'>sketchbook directory</a>. Then unzip the library there. For example, to install the <span class='wikiword'>DateTime</span> library, its files should be in the <strong>/<span class='wikiword'>libraries/DateTime</span></strong> sub-folder of your sketchbook folder.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a name='serialmonitor' id='serialmonitor'></a>
|
||||
</p><h3>Serial Monitor</h3>
|
||||
<p>Displays serial data being sent from the Arduino board (USB or serial board). To send data to the board, enter text and click on the "send" button or press enter. Choose the baud rate from the drop-down that matches the rate passed to <strong>Serial.begin</strong> in your sketch. Note that on Mac or Linux, the Arduino board will reset (rerun your sketch from the beginning) when you connect with the serial monitor.
|
||||
</p>
|
||||
<p class='vspace'></p><p>You can also talk to the board from Processing, Flash, <span class='wikiword'>MaxMSP</span>, etc (see the <a class='urllink' href='http://www.arduino.cc/playground/Main/Interfacing' rel='nofollow'>interfacing page</a> for details).
|
||||
</p>
|
||||
<p class='vspace'></p><p><a name='preferences' id='preferences'></a>
|
||||
</p><h3>Preferences</h3>
|
||||
<p>Some preferences can be set in the preferences dialog (found under the <strong>Arduino</strong> menu on the Mac, or <strong>File</strong> on Windows and Linux). The rest can be found in the preferences file, whose location is shown in the preference dialog.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a name='boards' id='boards'></a>
|
||||
</p><h3>Boards</h3>
|
||||
<p>The board selection has two effects: the parameters (e.g. CPU speed and baud rate) used when compiling and uploading sketches; and the file and fuse settings used by the burn bootloader command. Some of the board definitions differ only in the latter, so even if you've been uploading successfully with a particular selection you'll want to check it before burning the bootloader.
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><em>Arduino Duemilanove or Nano w/ <span class='wikiword'>ATmega328</span></em> <br clear='all' /> An <span class='wikiword'>ATmega328</span> running at 16 <span class='wikiword'>MHz</span> with auto-reset. Also used for the 16 <span class='wikiword'>MHz</span> (5V) versions of the Arduino Pro or Pro Mini with an <span class='wikiword'>ATmega328</span>.
|
||||
<p class='vspace'></p></li><li><em>Arduino Diecimila, Duemilanove, or Nano w/ <span class='wikiword'>ATmega168</span></em> <br clear='all' /> An <span class='wikiword'>ATmega168</span> running at 16 <span class='wikiword'>MHz</span> with auto-reset. Compilation and upload is equivalent to Arduino NG or older w/ <span class='wikiword'>ATmega168</span>, but the bootloader burned has a faster timeout (and blinks the pin 13 LED only once on reset). Also used for the 16 <span class='wikiword'>MHz</span> (5V) versions of the Arduino Pro and Pro Mini with an <span class='wikiword'>ATmega168</span>.
|
||||
<p class='vspace'></p></li><li><em>Arduino Mega</em> <br clear='all' /> An <span class='wikiword'>ATmega1280</span> running at 16 <span class='wikiword'>MHz</span> with auto-reset.
|
||||
<p class='vspace'></p></li><li><em>Arduino Mini</em> <br clear='all' /> Equivalent to Arduino NG or older w/ <span class='wikiword'>ATmega168</span> (i.e. an <span class='wikiword'>ATmega168</span> running at 16 <span class='wikiword'>MHz</span> without auto-reset).
|
||||
<p class='vspace'></p></li><li><em>Arduino BT</em> <br clear='all' /> <span class='wikiword'>ATmega168</span> running at 16 <span class='wikiword'>MHz</span>. The bootloader burned includes codes to initialize the on-board bluetooth module.
|
||||
<p class='vspace'></p></li><li><em><span class='wikiword'>LilyPad</span> Arduino w/ <span class='wikiword'>ATmega328</span></em> <br clear='all' /> An <span class='wikiword'>ATmega328</span> running at 8 <span class='wikiword'>MHz</span> (3.3V) with auto-reset. Equivalent to Arduino Pro or Pro Mini (3.3V, 8 <span class='wikiword'>MHz</span>) w/ <span class='wikiword'>ATmega328</span>.
|
||||
<p class='vspace'></p></li><li><em><span class='wikiword'>LilyPad</span> Arduino w/ <span class='wikiword'>ATmega168</span></em> <br clear='all' /> An <span class='wikiword'>ATmega168</span> running at 8 <span class='wikiword'>MHz</span>. Compilation and upload is equivalent to the Arduino Pro or Pro Mini (8 <span class='wikiword'>MHz</span>) w/ <span class='wikiword'>ATmega168</span>. The bootloader burned, however, has a slower timeout (and blinks the pin 13 LED three times on reset) because the original versions of the <span class='wikiword'>LilyPad</span> didn't support auto-reset. They also didn't include an external clock, so the burn bootloader command configures the fuses of <span class='wikiword'>ATmega168</span> for an internal 8 <span class='wikiword'>MHz</span> clock. <br clear='all' /> <br clear='all' /> If you have a recent version of the <span class='wikiword'>LilyPad</span>, (w/ a 6-pin programming header), you'll want to select Arduino Pro or Pro Mini (8 <span class='wikiword'>MHz</span>) w/ <span class='wikiword'>ATmega168</span> before burning the bootloader.
|
||||
<p class='vspace'></p></li><li><em>Arduino Pro or Pro Mini (3.3V, 8 <span class='wikiword'>MHz</span>) w/ <span class='wikiword'>ATmega328</span></em> <br clear='all' /> An <span class='wikiword'>ATmega328</span> running at 8 <span class='wikiword'>MHz</span> (3.3V) with auto-reset. Equivalent to <span class='wikiword'>LilyPad</span> Arduino w/ <span class='wikiword'>ATmega328</span>.
|
||||
<p class='vspace'></p></li><li><em>Arduino Pro or Pro Mini (3.3V, 8 <span class='wikiword'>MHz</span>) w/ <span class='wikiword'>ATmega168</span></em> <br clear='all' /> An <span class='wikiword'>ATmega168</span> running at 8 <span class='wikiword'>MHz</span> (3.3V) with auto-reset.
|
||||
<p class='vspace'></p></li><li><em>Arduino NG or older w/ <span class='wikiword'>ATmega168</span></em> <br clear='all' /> An <span class='wikiword'>ATmega168</span> running at 16 <span class='wikiword'>MHz</span> <em>without</em> auto-reset. Compilation and upload is equivalent to Arduino Diecimila or Duemilanove w/ <span class='wikiword'>ATmega168</span>, but the bootloader burned has a slower timeout (and blinks the pin 13 LED three times on reset).
|
||||
<p class='vspace'></p></li><li><em>Arduino NG or older w/ <span class='wikiword'>ATmega8</span></em> <br clear='all' /> An <span class='wikiword'>ATmega8</span> running at 16 <span class='wikiword'>MHz</span> <em>without</em> auto-reset.
|
||||
</li></ul><p class='vspace'></p><p>The text of the Arduino getting started guide is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the guide are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_Environment?action=edit.html'>Edit Page</a> | <a href='Guide_Environment?action=diff.html'>Page History</a> | <a href='Guide_Environment?action=print.html' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
61
arduino-0018-linux/reference/Guide_Guide.html
Normal file
61
arduino-0018-linux/reference/Guide_Guide.html
Normal file
|
@ -0,0 +1,61 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Guide </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc/">Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav">
|
||||
<p><a class='wikilink' href='Guide_index.html'>Guide</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Tutorial/HomePage'>Tutorials</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Software'>Software</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl' rel='nofollow'>Forum</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/playground/' rel='nofollow'>Playground</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/playground/Projects/ArduinoUsers' rel='nofollow'>Exhibition</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Hacking/HomePage'>Hacking</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/FAQ'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Buy'>Buy</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><a class='wikilink' href='Guide_index.html'>Introduction</a> | How To: <a class='wikilink' href='Guide_Windows.html'>Windows</a>, <a class='wikilink' href='Guide_MacOSX.html'>Mac OS X</a>, <a class='urllink' href='http://www.arduino.cc/playground/Learning/Linux' rel='nofollow'>Linux</a>; <a class='wikilink' href='Guide_ArduinoMini.html'>Arduino Mini</a>, <a class='wikilink' href='Guide_ArduinoBT.html'>Arduino BT</a> | <a class='wikilink' href='Guide_Troubleshooting.html'>Troubleshooting</a> | <a class='wikilink' href='Guide_Board.html'>Board</a> | <a class='wikilink' href='Guide_Environment.html'>Environment</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_Guide?action=edit.html'>Edit Page</a> | <a href='Guide_Guide?action=diff.html'>Page History</a> | <a href='Guide_Guide?action=print.html' target='_blank'>Printable View</a> | <a href='Guide_RecentChanges.html'>Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
81
arduino-0018-linux/reference/Guide_HomePage.html
Normal file
81
arduino-0018-linux/reference/Guide_HomePage.html
Normal file
|
@ -0,0 +1,81 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Guide </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc/">Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav">
|
||||
<p><a class='selflink' href='Guide_index.html'>Guide</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Tutorial/HomePage'>Tutorials</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Software'>Software</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/blog/' rel='nofollow'>Blog</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl' rel='nofollow'>Forum</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/playground/' rel='nofollow'>Playground</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/playground/Projects/ArduinoUsers' rel='nofollow'>Exhibition</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Hacking/HomePage'>Hacking</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/FAQ'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Buy'>Buy</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Guide</strong> <a class='selflink' href='Guide_index.html'>Contents</a> | <a class='wikilink' href='Guide_Introduction.html'>Introduction</a> | How To: <a class='wikilink' href='Guide_Windows.html'>Windows</a>, <a class='wikilink' href='Guide_MacOSX.html'>Mac OS X</a>, <a class='urllink' href='http://www.arduino.cc/playground/Learning/Linux' rel='nofollow'>Linux</a>; <a class='wikilink' href='Guide_ArduinoMini.html'>Arduino Mini</a>, <a class='wikilink' href='Guide_ArduinoBT.html'>Arduino BT</a>, <a class='wikilink' href='Guide_ArduinoLilyPad.html'>LilyPad Arduino</a>; <a class='wikilink' href='Guide_ArduinoXbeeShield.html'>Xbee shield</a> | <a class='wikilink' href='Guide_Troubleshooting.html'>Troubleshooting</a> | <a class='wikilink' href='Guide_Board.html'>Board</a> | <a class='wikilink' href='Guide_Environment.html'>Environment</a>
|
||||
</p><h2>Guide to Arduino</h2>
|
||||
<table width='90%' border='0' cellpadding='5' cellspacing='0'><tr><td width='50%' valign='top'>
|
||||
<p class='vspace'></p><h3>In This Guide</h3>
|
||||
<p>This guide tell you everything you need to get started with Arduino. It consists of the following pages:
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><a class='wikilink' href='Guide_Introduction.html'>Introduction</a>: an explanation of what Arduino is and why you'd want to use it.
|
||||
</li><li>How To (<a class='wikilink' href='Guide_Windows.html'>Windows</a>, <a class='wikilink' href='Guide_MacOSX.html'>Mac OS X</a>, <a class='urllink' href='http://www.arduino.cc/playground/Learning/Linux' rel='nofollow'>Linux</a>; <a class='wikilink' href='Guide_ArduinoMini.html'>Arduino Mini</a>, <a class='wikilink' href='Guide_ArduinoBT.html'>Arduino BT</a>, <a class='wikilink' href='Guide_ArduinoLilyPad.html'>LilyPad Arduino</a>; <a class='wikilink' href='Guide_ArduinoXbeeShield.html'>Xbee shield</a>): step-by-step instructions on getting your first Arduino program working.
|
||||
</li><li><a class='wikilink' href='Guide_Troubleshooting.html'>Troubleshooting</a>: what to do if things don't work.
|
||||
</li><li><a class='wikilink' href='Guide_Board.html'>Board</a>: description of the Arduino board and its parts.
|
||||
</li><li><a class='wikilink' href='Guide_Environment.html'>Environment</a>: description of the Arduino development environment and its parts.
|
||||
</li></ul><p class='vspace'></p><h3>Elsewhere on the Arduino website</h3>
|
||||
<ul><li><a class='wikilink' href='http://www.arduino.cc/en/Booklet/HomePage'>Arduino booklet</a>: an introduction to physical computing, electronics, and Arduino.
|
||||
</li></ul><p class='vspace'></p></td><td width='50%' valign='top'>
|
||||
<p class='vspace'></p><h3>External Resources</h3>
|
||||
<ul><li><a class='urllink' href='http://todbot.com/blog/spookyarduino/' rel='nofollow'>Course guides</a>: Longer documents introducing Arduino: <a class='urllink' href='http://todbot.com/blog/wp-content/uploads/2006/10/arduino_spooky_projects_class1.pdf' rel='nofollow'>class 1 (getting started)</a>, <a class='urllink' href='http://todbot.com/blog/wp-content/uploads/2006/10/arduino_spooky_projects_class2.pdf' rel='nofollow'>class 2 (input and sensors)</a>, <a class='urllink' href='http://todbot.com/blog/wp-content/uploads/2006/10/arduino_spooky_projects_class3.pdf' rel='nofollow'>class 3 (communication, servos, and pwm)</a>, <a class='urllink' href='http://todbot.com/blog/wp-content/uploads/2006/10/arduino_spooky_projects_class4.pdf' rel='nofollow'>class 4 (piezo sound & sensors, arduino+processing, stand-alone operation)</a>.
|
||||
<p class='vspace'></p></li><li><a class='urllink' href='http://wiring.org.co/reference/electronics/index.html' rel='nofollow'>Wiring electronics reference</a>: circuit diagrams for connecting a variety of basic electronic components.
|
||||
<p class='vspace'></p></li><li><a class='urllink' href='http://wiring.org.co/learning/tutorials/diagrams.html' rel='nofollow'>Schematics to circuits</a>: from Wiring, a guide to transforming circuit diagrams into physical circuits.
|
||||
<p class='vspace'></p></li><li><a class='urllink' href='http://tigoe.net/pcomp/' rel='nofollow'>Tom Igoe's Physical Computing Site</a>: lots of information on electronics, microcontrollers, sensors, actuators, books, etc.
|
||||
</li></ul><p class='vspace'></p></td></tr></table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_HomePage?action=edit.html'>Edit Page</a> | <a href='Guide_HomePage?action=diff.html'>Page History</a> | <a href='Guide_HomePage?action=print.html' target='_blank'>Printable View</a> | <a href='Guide_RecentChanges.html'>Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
79
arduino-0018-linux/reference/Guide_Introduction.html
Normal file
79
arduino-0018-linux/reference/Guide_Introduction.html
Normal file
|
@ -0,0 +1,79 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Introduction </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<h3>What is Arduino?</h3>
|
||||
<p>Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It's an open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software for the board.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Arduino can be used to develop interactive objects, taking inputs from a variety of switches or sensors, and controlling a variety of lights, motors, and other physical outputs. Arduino projects can be stand-alone, or they can be communicate with software running on your computer (e.g. Flash, Processing, <span class='wikiword'>MaxMSP</span>.) The boards can be assembled by hand or purchased preassembled; the open-source IDE can be downloaded for free.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The Arduino programming language is an implementation of Wiring, a similar physical computing platform, which is based on the Processing multimedia programming environment.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Why Arduino?</h3>
|
||||
<p>There are many other microcontrollers and microcontroller platforms available for physical computing. Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's Handyboard, and many others offer similar functionality. All of these tools take the messy details of microcontroller programming and wrap it up in an easy-to-use package. Arduino also simplifies the process of working with microcontrollers, but it offers some advantage for teachers, students, and interested amateurs over other systems:
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li>Inexpensive - Arduino boards are relatively inexpensive compared to other microcontroller platforms. The least expensive version of the Arduino module can be assembled by hand, and even the pre-assembled Arduino modules cost less than $50
|
||||
<p class='vspace'></p></li><li>Cross-platform - The Arduino software runs on Windows, Macintosh OSX, and Linux operating systems. Most microcontroller systems are limited to Windows.
|
||||
<p class='vspace'></p></li><li>Simple, clear programming environment - The Arduino programming environment is easy-to-use for beginners, yet flexible enough for advanced users to take advantage of as well. For teachers, it's conveniently based on the Processing programming environment, so students learning to program in that environment will be familiar with the look and feel of Arduino
|
||||
<p class='vspace'></p></li><li>Open source and extensible software- The Arduino software and is published as open source tools, available for extension by experienced programmers. The language can be expanded through C++ libraries, and people wanting to understand the technical details can make the leap from Arduino to the AVR C programming language on which it's based. <span class='wikiword'>SImilarly</span>, you can add AVR-C code directly into your Arduino programs if you want to.
|
||||
<p class='vspace'></p></li><li>Open source and extensible hardware - The Arduino is based on Atmel's <span class='wikiword'>ATMEGA8</span> and <span class='wikiword'>ATMEGA168</span> microcontrollers. The plans for the modules are published under a Creative Commons license, so experienced circuit designers can make their own version of the module, extending it and improving it. Even relatively inexperienced users can build the breadboard version of the module in order to understand how it works and save money.
|
||||
</li></ul><p class='vspace'></p><h3>How do I use Arduino?</h3>
|
||||
<p>See the <a class='wikilink' href='Guide_index.html'>getting started guide</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino getting started guide is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the guide are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_Introduction?action=edit.html'>Edit Page</a> | <a href='Guide_Introduction?action=diff.html'>Page History</a> | <a href='Guide_Introduction?action=print.html' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
125
arduino-0018-linux/reference/Guide_MacOSX.html
Normal file
125
arduino-0018-linux/reference/Guide_MacOSX.html
Normal file
|
@ -0,0 +1,125 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - MacOSX </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<h2>How To Get Arduino Running on Mac OS X (10.3.9 or later)</h2>
|
||||
<p><em>This document explains how to connect your Arduino board to the computer and upload your first sketch.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>These are the steps that we'll go through:
|
||||
</p>
|
||||
<p class='vspace'></p><ol><li>Get an Arduino board and cable
|
||||
</li><li>Download the Arduino environment
|
||||
</li><li>Install the USB drivers
|
||||
</li><li>Connect the board
|
||||
</li><li>Run the Arduino environment
|
||||
</li><li>Upload a program
|
||||
</li><li>Look for the blinking LED
|
||||
</li><li>Learn to use Arduino
|
||||
</li></ol><p class='vspace'></p><h3>1 | Get an Arduino board and cable</h3>
|
||||
<p>In this tutorial, we assume you're using an Arduino Duemilanove or Diecimila. If you have another board, read the corresponding page in this getting started guide.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The Arduino is a simple board that contains everything you need to start working with electronics and microcontroller programming. This diagram illustrates the major components of an Arduino Diecimila. (The Arduino Duemilanove is almost identical.)
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/ArduinoDiecimilaComponents.jpg' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p>You also need a standard USB cable (A plug to B plug): the kind you would connect to a USB printer, for example.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>2 | Download the Arduino environment</h3>
|
||||
<p>To program the Arduino board you need the Arduino environment.
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>Download</strong>: the latest version from the <a class='wikilink' href='http://arduino.cc/en/Main/Software'>download page</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><p>When the download finishes, unzip the downloaded file. Make sure to preserve the folder structure. Double-click the folder to open it. There should be a few files and sub-folders inside.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>3 | Install the USB drivers</h3>
|
||||
<p>If you are using a USB Arduino, you will need to install the drivers for the FTDI chip on the board. These can be found in the <strong>drivers</strong> directory of the Arduino distribution.
|
||||
</p>
|
||||
<p class='vspace'></p><p>You'll need to select the correct drivers for your computer. Use:
|
||||
</p><ul><li><strong><span class='wikiword'>FTDIUSBSerialDriver</span>_v2_1_9.dmg</strong> for older (PPC) Macs like the Powerbook, iBook, G4 or G5
|
||||
</li><li><strong><span class='wikiword'>FTDIUSBSerialDriver</span>_v2_2_9_Intel.dmg</strong> for newer (Intel) Macs like the <span class='wikiword'>MacBook</span>, <span class='wikiword'>MacBook</span> Pro, or Mac Pro
|
||||
</li></ul><p class='vspace'></p><p>(The latest version of the drivers can be found on the <a class='urllink' href='http://www.ftdichip.com/Drivers/VCP.htm' rel='nofollow'>FTDI website</a>.)
|
||||
</p>
|
||||
<p class='vspace'></p><h3>4 | Connect the board</h3>
|
||||
<p>On the Diecimila, the power source is selected by the jumper between the USB and power plugs. To power the board from the USB port (good for controlling low power devices like <span class='wikiword'>LEDs</span>), place the jumper on the two pins closest to the USB plug. To power the board from an external power supply (6-12V), place the jumper on the two pins closest to the power plug. On the Duemilanove, the power source is selected automatically (there is no power selection jumper). In any case, connect the board to a USB port on your computer.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The green power LED (labelled <strong>PWR</strong>) should go on.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>5 | Run the Arduino environment</h3>
|
||||
<p>(Mac OSX): Copy the Arduino application to your Applications directory. Double-click the Arduino application.
|
||||
</p>
|
||||
<p class='vspace'></p><p>(Windows): Open the Arduino folder and double-click the Arduino application.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>6 | Upload a program</h3>
|
||||
<p>Open the LED blink example sketch: <strong>File > Sketchbook > Examples > Digital > Blink</strong>.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Select the serial device of the Arduino board from the <strong>Tools > Serial Port</strong> menu. On the Mac, this should be something with <strong>/dev/tty.usbserial</strong> in it.
|
||||
</p>
|
||||
<p class='vspace'></p><p>You'll need to select the entry in the <strong>Tools > Board</strong> menu that corresponds to your Arduino. For newer Arduino boards with an <span class='wikiword'>ATmega328</span> (check the text on the chip on the board), select <strong>Arduino Duemilanove w/ <span class='wikiword'>ATmega328</span></strong>. Previously, Arduino boards came with an <span class='wikiword'>ATmega168</span>; for those, select <strong>Arduino Diecimila or Duemilanove w/ <span class='wikiword'>ATmega168</span></strong>.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Now, simply click the "Upload" button in the environment. Wait a few seconds - you should see the RX and TX leds on the board flashing. If the upload is successful, the message "Done uploading." will appear in the status bar. (<em>Note:</em> If you have an Arduino Mini, NG, or other board, you'll need to physically present the reset button on the board immediately before pressing the upload button.)
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/UploadButton.png' alt='' title='' /></div>
|
||||
<p class='vspace'></p><h3>7 | Look for the blinking LED</h3>
|
||||
<p>A few seconds after the upload finishes, you should see the pin 13 (L) LED on the board start to blink (in orange). If it does, congratulations! You've gotten Arduino up-and-running.
|
||||
</p>
|
||||
<p class='vspace'></p><p>If you have problems, please see the <a class='wikilink' href='Guide_Troubleshooting.html'>troubleshooting suggestions</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>8 | Learn to use Arduino</h3>
|
||||
<ul><li><a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Examples</a>: try these example programs.
|
||||
</li><li><a class='wikilink' href='index.html'>Reference</a>: read the reference for the Arduino language.
|
||||
</li></ul><p>The text of the Arduino getting started guide is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the guide are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_MacOSX?action=edit.html'>Edit Page</a> | <a href='Guide_MacOSX?action=diff.html'>Page History</a> | <a href='Guide_MacOSX?action=print.html' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
135
arduino-0018-linux/reference/Guide_RecentChanges.html
Normal file
135
arduino-0018-linux/reference/Guide_RecentChanges.html
Normal file
|
@ -0,0 +1,135 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - RecentChanges </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc/">Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav">
|
||||
<p><a class='wikilink' href='Guide_index.html'>Guide</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Tutorial/HomePage'>Tutorials</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Software'>Software</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/blog/' rel='nofollow'>Blog</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl' rel='nofollow'>Forum</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/playground/' rel='nofollow'>Playground</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/playground/Projects/ArduinoUsers' rel='nofollow'>Exhibition</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Hacking/HomePage'>Hacking</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/FAQ'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Buy'>Buy</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Guide</strong> <a class='wikilink' href='Guide_index.html'>Contents</a> | <a class='wikilink' href='Guide_Introduction.html'>Introduction</a> | How To: <a class='wikilink' href='Guide_Windows.html'>Windows</a>, <a class='wikilink' href='Guide_MacOSX.html'>Mac OS X</a>, <a class='urllink' href='http://www.arduino.cc/playground/Learning/Linux' rel='nofollow'>Linux</a>; <a class='wikilink' href='Guide_ArduinoMini.html'>Arduino Mini</a>, <a class='wikilink' href='Guide_ArduinoBT.html'>Arduino BT</a>, <a class='wikilink' href='Guide_ArduinoLilyPad.html'>LilyPad Arduino</a>; <a class='wikilink' href='Guide_ArduinoXbeeShield.html'>Xbee shield</a> | <a class='wikilink' href='Guide_Troubleshooting.html'>Troubleshooting</a> | <a class='wikilink' href='Guide_Board.html'>Board</a> | <a class='wikilink' href='Guide_Environment.html'>Environment</a>
|
||||
</p><ul><li><a class='wikilink' href='Guide_Troubleshooting.html'>Troubleshooting</a> . . . October 06, 2007, at 02:14 PM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_GroupHeader.html'>GroupHeader</a> . . . October 04, 2007, at 09:53 AM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_index.html'>HomePage</a> . . . October 04, 2007, at 09:53 AM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>: adding link to lilypad guide
|
||||
</li><li><a class='wikilink' href='Guide_ArduinoLilyPad.html'>ArduinoLilyPad</a> . . . October 03, 2007, at 11:51 AM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/Profiles/LeahBuechley?action=edit'>Leah Buechley</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/Profiles/LeahBuechley?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_Introduction.html'>Introduction</a> . . . September 01, 2007, at 12:01 AM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_HowtoExample.html'>HowtoExample</a> . . . August 17, 2007, at 09:00 AM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_ArduinoXbeeShield.html'>ArduinoXbeeShield</a> . . . August 15, 2007, at 06:47 PM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_Environment.html'>Environment</a> . . . August 07, 2007, at 11:39 AM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_HowtoLED.html'>HowtoLED</a> . . . August 07, 2007, at 11:37 AM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_HowtoUpload.html'>HowtoUpload</a> . . . August 07, 2007, at 11:34 AM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_HowtoConnect.html'>HowtoConnect</a> . . . August 07, 2007, at 11:22 AM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>: specifying voltage range for usb boards
|
||||
</li><li><a class='wikilink' href='Guide_MacOSX.html'>MacOSX</a> . . . August 06, 2007, at 09:45 PM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_Windows.html'>Windows</a> . . . August 06, 2007, at 09:44 PM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>: updating software version to 0009.
|
||||
</li><li><a class='wikilink' href='Guide_Troubleshooting2.html'>Troubleshooting2</a> . . . July 18, 2007, at 10:05 AM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_ArduinoBT.html'>ArduinoBT</a> . . . June 15, 2007, at 06:01 PM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_ArduinoMini.html'>ArduinoMini</a> . . . June 15, 2007, at 05:52 PM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_HowtoSteps.html'>HowtoSteps</a> . . . March 03, 2007, at 03:13 PM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_HowtoGet.html'>HowtoGet</a> . . . February 21, 2007, at 03:48 PM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_References.html'>References</a> . . . November 04, 2006, at 02:11 PM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_HowtoReferences.html'>HowtoReferences</a> . . . November 04, 2006, at 07:50 AM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_HowtoDownload.html'>HowtoDownload</a> . . . November 04, 2006, at 07:47 AM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_Howto.html'>Howto</a> . . . November 04, 2006, at 07:14 AM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>: adding new hardware wizard screenshots
|
||||
</li><li><a class='wikilink' href='Guide_Board.html'>Board</a> . . . October 26, 2006, at 04:23 PM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li><li><a class='wikilink' href='Guide_Guide.html'>Guide</a> . . . October 22, 2006, at 01:19 PM by <a class='createlinktext' rel='nofollow'
|
||||
href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>David A. Mellis</a><a rel='nofollow'
|
||||
class='createlink' href='http://www.arduino.cc/en/DavidA/Mellis?action=edit'>?</a>:
|
||||
</li></ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_RecentChanges?action=edit.html'>Edit Page</a> | <a href='Guide_RecentChanges?action=diff.html'>Page History</a> | <a href='Guide_RecentChanges?action=print.html' target='_blank'>Printable View</a> | <a href='Guide_RecentChanges.html'>Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
82
arduino-0018-linux/reference/Guide_References.html
Normal file
82
arduino-0018-linux/reference/Guide_References.html
Normal file
|
@ -0,0 +1,82 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - References </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc/">Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav">
|
||||
<p><a class='wikilink' href='Guide_index.html'>Guide</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Tutorial/HomePage'>Tutorials</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Software'>Software</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl' rel='nofollow'>Forum</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/playground/' rel='nofollow'>Playground</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/playground/Projects/ArduinoUsers' rel='nofollow'>Exhibition</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Hacking/HomePage'>Hacking</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/FAQ'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Buy'>Buy</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><a class='wikilink' href='Guide_index.html'>Introduction</a> | How To: <a class='wikilink' href='Guide_Windows.html'>Windows</a>, <a class='wikilink' href='Guide_MacOSX.html'>Mac OS X</a>, <a class='urllink' href='http://www.arduino.cc/playground/Learning/Linux' rel='nofollow'>Linux</a>; <a class='wikilink' href='Guide_ArduinoMini.html'>Arduino Mini</a>, <a class='wikilink' href='Guide_ArduinoBT.html'>Arduino BT</a> | <a class='wikilink' href='Guide_Troubleshooting.html'>Troubleshooting</a> | <a class='wikilink' href='Guide_Board.html'>Board</a> | <a class='wikilink' href='Guide_Environment.html'>Environment</a>
|
||||
</p><h2>Other Resources</h2>
|
||||
<h3>On the Arduino Website</h3>
|
||||
<ul><li><a class='wikilink' href='http://www.arduino.cc/en/Tutorial/HomePage'>Tutorials</a>: code examples and circuits for performing many tasks.
|
||||
<p class='vspace'></p></li><li><a class='wikilink' href='index.html'>Reference</a>: documentation of the Arduino programming language and functions.
|
||||
<p class='vspace'></p></li><li><a class='wikilink' href='http://www.arduino.cc/en/Main/Hardware'>Hardware</a>: descriptions of the various Arduino boards and other hardware, with schematics, PCB layout files, assembly instructions, etc.
|
||||
<p class='vspace'></p></li><li><a class='wikilink' href='http://www.arduino.cc/en/Main/ComparisonProcessing'>Language comparison</a>: compares the Arduino/Wiring language (based on C/C++) with Processing (based on Java).
|
||||
<p class='vspace'></p></li><li><a class='wikilink' href='http://www.arduino.cc/en/Main/FAQ'>FAQ</a>: frequently asked questions about Arduino.
|
||||
<p class='vspace'></p></li><li><a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl' rel='nofollow'>Discussion forums</a>: for questions about anything Arduino related.
|
||||
<p class='vspace'></p></li><li><a class='urllink' href='http://www.arduino.cc/playground/' rel='nofollow'>Playground</a>: a publicly editable wiki collecting community documentation (<a class='urllink' href='http://www.arduino.cc/playground/Main/Participate#requestaccess' rel='nofollow'>register here</a>).
|
||||
</li></ul><p class='vspace'></p><h3>External Resources on Arduino</h3>
|
||||
<ul><li><a class='urllink' href='http://www.sbk.flr4.org/arduino/index.html' rel='nofollow'>Video lectures</a>: Tom Igoe introduces Arduino. (thanks to Pollie Barden).
|
||||
<p class='vspace'></p></li><li><a class='urllink' href='http://todbot.com/blog/spookyarduino/' rel='nofollow'>Course guides</a>: Longer documents introducing Arduino: <a class='urllink' href='http://todbot.com/blog/wp-content/uploads/2006/10/arduino_spooky_projects_class1.pdf' rel='nofollow'>class 1 (getting started)</a>, <a class='urllink' href='http://todbot.com/blog/wp-content/uploads/2006/10/arduino_spooky_projects_class2.pdf' rel='nofollow'>class 2 (input and sensors)</a>, <a class='urllink' href='http://todbot.com/blog/wp-content/uploads/2006/10/arduino_spooky_projects_class3.pdf' rel='nofollow'>class 3 (communication, servos, and pwm)</a>, <a class='urllink' href='http://todbot.com/blog/wp-content/uploads/2006/10/arduino_spooky_projects_class4.pdf' rel='nofollow'>class 4 (piezo sound & sensors, arduino+processing, stand-alone operation)</a>.
|
||||
</li></ul><p class='vspace'></p><h3>Electronics and Physical Computing</h3>
|
||||
<ul><li><a class='urllink' href='http://wiring.org.co/reference/electronics/index.html' rel='nofollow'>Wiring electronics reference</a>: circuit diagrams for connecting a variety of basic electronic components.
|
||||
<p class='vspace'></p></li><li><a class='urllink' href='http://wiring.org.co/learning/tutorials/diagrams.html' rel='nofollow'>Schematics to circuits</a>: from Wiring, a guide to transforming circuit diagrams into physical circuits.
|
||||
<p class='vspace'></p></li><li><a class='urllink' href='http://www.opencircuits.com/Main_Page' rel='nofollow'>Open Circuits</a>: a public wiki collecting electronic circuits, components, and techniques.
|
||||
<p class='vspace'></p></li><li><a class='urllink' href='http://tigoe.net/pcomp/' rel='nofollow'>Tom Igoe's Physical Computing Site</a>: lots of information on electronics, microcontrollers, sensors, actuators, books, etc.
|
||||
</li></ul><p class='vspace'></p><h3>Related Sites</h3>
|
||||
<ul><li><a class='urllink' href='http://www.instantsoup.org/' rel='nofollow'>Instant Soup</a> is an introduction to electronics through a series of beautifully-documented fun projects.
|
||||
<p class='vspace'></p></li><li><a class='urllink' href='http://www.makezine.com/' rel='nofollow'>Make magazine</a> has some great links in its <a class='urllink' href='http://www.makezine.com/blog/archive/electronics/' rel='nofollow'>electronics archive</a>.
|
||||
<p class='vspace'></p></li><li><a class='urllink' href='http://www.hackaday.com/' rel='nofollow'>hack a day</a> has links to interesting hacks and how-to articles on various topics.
|
||||
</li></ul><p class='vspace'></p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_References?action=edit.html'>Edit Page</a> | <a href='Guide_References?action=diff.html'>Page History</a> | <a href='Guide_References?action=print.html' target='_blank'>Printable View</a> | <a href='Guide_RecentChanges.html'>Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
257
arduino-0018-linux/reference/Guide_Troubleshooting.html
Normal file
257
arduino-0018-linux/reference/Guide_Troubleshooting.html
Normal file
|
@ -0,0 +1,257 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Troubleshooting </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<h2>Arduino Troubleshooting</h2>
|
||||
<div class='toc'><p><a name='toc' id='toc'></a><b>On this page...</b> (<a id="tocidtog" href="javascript:toggle('tocid');">hide</a>)</p><ul class='toc' id='tocid'><li><a href='#toc1'>Why I can't upload my programs to the Arduino board?</a></li><li><a href='#toc2'>Why do I get "Build folder disappeared or could not be written" (Mac OS X)?</a></li><li><a href='#toc3'>Why doesn't the Arduino software run after I updated the Java on my Mac?</a></li><li><a href='#toc4'>Why do I get a java.lang.StackOverflowError when I try to compile my program?</a></li><li><a href='#toc5'>Why doesn't my sketch start when I'm powering the board with an external power supply? (Arduino Diecimila or earlier)</a></li><li><a href='#toc6'>Why does the Arduino software freeze when I try to upload a program? (on Windows)?</a></li><li><a href='#toc7'>What if my board doesn't turn on (the green power LED doesn't light up)?</a></li><li><a href='#toc8'>Why does my Diecimila take such a long time (6-8 seconds) to start my sketch?</a></li><li><a href='#toc9'>What should I do if I get an error when launching arduino.exe on Windows?</a></li><li><a href='#toc10'>Why won't Arduino run on old versions of Mac OS X?</a></li><li><a href='#toc11'>What do I do if I get an UnsatisfiedLinkError error (about native library librxtxSerial.jnilib) when launching Arduino?</a></li><li><a href='#toc12'>What about the error "Could not find the main class."?</a></li><li><a href='#toc13'>What can I do about cygwin conflicts on Windows?</a></li><li><a href='#toc14'>Why does do the Arduino software and the Tools menu take a long time to open (on Windows)?</a></li><li><a href='#toc15'>Why doesn't my board show in the Tools | Serial Port menu ?</a></li><li><a href='#toc16'>What if I get a gnu.io.PortInUseException when uploading code or using the serial monitor (on the Mac)?</a></li><li><a href='#toc17'>I'm having trouble with the FTDI USB drivers.</a></li><li><a href='#toc18'>Why doesn't my sketch start when I power up or reset the Arduino board?</a></li><li><a href='#toc19'>Why does my sketch appear to upload successfully but not do anything?</a></li><li><a href='#toc20'>How can I reduce the size of my sketch?</a></li><li><a href='#toc21'>Why don't I get a PWM (an analog output) when I call analogWrite() on pins other than 3, 5, 6, 9, 10, or 11?</a></li><li><a href='#toc22'>Why do I get errors about undeclared functions or undeclared types?</a></li><li><a href='#toc23'>Why do I get errors about an invalid device signature when trying to upload a sketch?</a></li></ul></div>
|
||||
<p class='vspace'></p><p><a name='upload' id='upload'></a>
|
||||
</p><h3><a name='toc1' id='toc1'></a>Why I can't upload my programs to the Arduino board?</h3>
|
||||
<p>There are a few things that could be wrong.
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li>First make sure your board is on (the green LED is on) and connected to the computer (if it's not, see "what if my board doesn't turn on" above).
|
||||
<p class='vspace'></p></li><li>Then, check that the proper port is selected in the "Tools > Serial Port" menu (if your port doesn't appear, restart the IDE with the board connected to the computer).
|
||||
<p class='vspace'></p></li><li>Make sure you have the right item selected in the <strong>Tools > Board</strong> menu. In particular, newer Arduino Duemilanove boards come with an <span class='wikiword'>ATmega328</span>, while older ones have an <span class='wikiword'>ATmega168</span>. To check, read the text on the microcontroller (the larger chip) on your Arduino board. For more information on the board menu items, see the <a class='wikilink' href='Guide_Environment.html'>guide to the Arduino environment</a>.
|
||||
<p class='vspace'></p></li><li>Disconnect digital pins 0 and 1 while uploading (they can connected and used after the code has been uploaded).
|
||||
<p class='vspace'></p></li><li>Try uploading with nothing connected to the board (apart from the USB cable, of course).
|
||||
<p class='vspace'></p></li><li>Make sure the board isn't touching anything metallic or conductive.
|
||||
<p class='vspace'></p></li><li>Check that you're not running any programs that scan all serial ports, like PDA sync applications, Bluetooth-USB drivers (e.g. <span class='wikiword'>BlueSoleil</span>), virtual daemon tools, etc.
|
||||
<p class='vspace'></p></li><li>Make sure you don't have firewall software that blocks access to the serial port (e.g. <span class='wikiword'>ZoneAlarm</span>).
|
||||
<p class='vspace'></p></li><li>You may need to quit Processing, PD, vvvv, etc. if you're using them to read data over the USB or serial connection to the Arduino board.
|
||||
<p class='vspace'></p></li><li>If you have a board that doesn't support auto-reset, be sure that you are resetting the board a couple of seconds before uploading. (The Arduino Diecimila, Duemilanove, and Nano support auto-reset as do the <span class='wikiword'>LilyPad</span>, Pro, and Pro Mini with 6-pin programming headers).
|
||||
<p class='vspace'></p></li><li>However, note that some Diecimila were accidently burned with the wrong bootloader and may require you to physically press the reset button before uploading; see <a href='#wrongbootloader'>this question</a> below.
|
||||
<p class='vspace'></p></li><li>However, on some computers, you may need to press the reset button on the board after you hit the upload button in the Arduino environment. Try different intervals of time between the two, up to 10 seconds or more.
|
||||
<p class='vspace'></p></li><li>If you get this error: <code>[VP 1] Device is not responding correctly.</code> try uploading again (i.e. reset the board and press the download button a second time).
|
||||
<p class='vspace'></p></li><li>Make sure there's a bootloader burned on your Arduino board. To check, connect an LED to pin 13 and reset the board. The LED should blink. If it doesn't, see the <a class='wikilink' href='http://arduino.cc/en/Hacking/Bootloader'>Bootloader</a> page for instructions on burning a bootloader to the board.
|
||||
<p class='vspace'></p></li><li>If you have a really ancient Arduino board, you may need to change the baud rate at which sketches are uploaded to 9600 (from the normal 19200). You will have to change the speed in the <em>preferences</em> file directly. See the <a class='wikilink' href='http://arduino.cc/en/Hacking/Preferences'>preferences</a> page for instructions on finding the file. Look for the file in your computer and change the <strong>serial.download_rate</strong> property to match the one in your board. If you have such a board, it's recommended that you burn the latest bootloader (which works at 19200 baud). This can be done with the <em>'Tools | Burn Bootloader</em> menu item.
|
||||
</li></ul><p class='vspace'></p><p>If it still doesn't work, you can ask for help <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=troubleshoot' rel='nofollow'>in the forum</a>. Please include the following information:
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li>Your operating system.
|
||||
<p class='vspace'></p></li><li>What kind of board you have. If it's a Mini, <span class='wikiword'>LilyPad</span> or other board that requires extra wiring, include a photo of your circuit, if possible.
|
||||
<p class='vspace'></p></li><li>Whether or not you were ever able to upload to the board. If so, what were you doing with the board before / when it stopped working, and what software have you recently added or removed from your computer?
|
||||
<p class='vspace'></p></li><li>The messages displayed when you try to upload with verbose output enabled. To do this, you'll need to set upload.verbose to true in your <a class='wikilink' href='http://arduino.cc/en/Hacking/Preferences'>Arduino preferences file</a>.
|
||||
</li></ul><p class='vspace'></p><h3><a name='toc2' id='toc2'></a>Why do I get "Build folder disappeared or could not be written" (Mac OS X)?</h3>
|
||||
<p>Did you drag the Arduino.app out of the disk image (and into, say, your Applications folder)? If not, you won't be able to upload the examples.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a name='macupdate' id='macupdate'></a>
|
||||
</p><h3><a name='toc3' id='toc3'></a>Why doesn't the Arduino software run after I updated the Java on my Mac?</h3>
|
||||
<p>The latest Java update from Apple attempts to use 64-bit version of native libraries, but the Arduino application comes with a 32 bit version of the RXTX library. If you launch Arduino, you'll get an error like:
|
||||
</p>
|
||||
<p class='vspace'></p><p><code>Uncaught exception in main method: java.<span class='wikiword'>lang.UnsatisfiedLinkError</span>: /Applications/arduino-0016/Arduino 16.app/Contents/Resources/Java/librxtxSerial.jnilib: no suitable image found. Did find: /Applications/arduino-0016/Arduino 16.app/Contents/Resources/Java/librxtxSerial.jnilib: no matching architecture in universal wrapper</code>
|
||||
</p>
|
||||
<p class='vspace'></p><p>To fix this, click on the Arduino application (e.g. <strong>Arduino 16.app</strong>) in the Finder, and select <strong>Get Info</strong> from the <strong>File</strong> menu. In the info panel, click the <strong>Open in 32 Bit Mode</strong> checkbox. You should then be able to launch Arduino normally.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a name='stackoverflow' id='stackoverflow'></a>
|
||||
</p><h3><a name='toc4' id='toc4'></a>Why do I get a java.<span class='wikiword'>lang.StackOverflowError</span> when I try to compile my program?</h3>
|
||||
<p>The Arduino environment does some preliminary processing on your sketch by manipulating the code using regular expressions. This sometimes gets confused by certain strings of text. If you see an error like:
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
java.lang.StackOverflowError
|
||||
at java.util.Vector.addElement(Unknown Source)
|
||||
at java.util.Stack.push(Unknown Source)
|
||||
at com.oroinc.text.regex.Perl5Matcher._pushState(Perl5Matcher.java)
|
||||
</pre>
|
||||
<p class='vspace'></p><p>this is what's happening. Look for unusual sequences involving "double-quotes", "single-quotes", \backslashes, comments, etc. In particular the sequence '\"' seems to cause problems; use '"' instead.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a name='externalpower' id='externalpower'></a>
|
||||
</p><h3><a name='toc5' id='toc5'></a>Why doesn't my sketch start when I'm powering the board with an external power supply? (Arduino Diecimila or earlier)</h3>
|
||||
<p>Because the RX pin is unconnected, the bootloader on the board may be seeing garbage data coming in, meaning that it never times out and starts your sketch. Try tying the RX pin to ground with a 10K resistor (or connecting it to the TX pin).
|
||||
</p>
|
||||
<p class='vspace'></p><h3><a name='toc6' id='toc6'></a>Why does the Arduino software freeze when I try to upload a program? (on Windows)?</h3>
|
||||
<p>This might be caused by a conflict with the Logitech process '<span class='wikiword'>LVPrcSrv</span>.exe'. Open the Task Manager and see if this program is running, and if so, kill it before attempting the upload. <a class='urllink' href='http://lists-archives.org/mingw-users/03939-as-exe-hanging-intermittently-solved.html' rel='nofollow'>more information</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a name='power' id='power'></a>
|
||||
</p><h3><a name='toc7' id='toc7'></a>What if my board doesn't turn on (the green power LED doesn't light up)?</h3>
|
||||
<p>If you're using a USB board, make sure that the jumper (little plastic piece near the USB plug) is on the correct pins. If you're powering the board with an external power supply (plugged into the power plug), the jumper should be on the two pins closest to the power plug. If you're powering the board through the USB, the jumper should be on the two pins closest to the USB plug. This picture shows the arrangment for powering the board from the USB port.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='createlinktext' href='Guide_Troubleshooting?action=upload&upname=jumper.jpg.html'>Attach:jumper.jpg</a><a class='createlink' href='Guide_Troubleshooting?action=upload&upname=jumper.jpg.html'> Δ</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p>(thanks to mrbbp for report and picture)
|
||||
</p>
|
||||
<p class='vspace'></p><p><a name='wrongbootloader' id='wrongbootloader'></a>
|
||||
</p><h3><a name='toc8' id='toc8'></a>Why does my Diecimila take such a long time (6-8 seconds) to start my sketch?</h3>
|
||||
<p>Some of the Arduino Diecimila boards were accidently burned with the Arduino NG bootloader. It should work fine, but has a longer delay when the board is reset (because the NG doesn't have an automatic reset, so you have to time the uploads manually). You can recognize the NG bootloader because the LED on pin 13 will blink three times when you reset the board (as compared to once with the Diecimila bootloader). If your Diecimila has the NG bootloader on it, you may need to physically press the reset button on the board before uploading your sketch. You can burn the correct bootloader onto your Diecimila, see the <a class='wikilink' href='http://arduino.cc/en/Hacking/Bootloader'>bootloader</a> page for details.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a name='startup' id='startup'></a>
|
||||
</p><h3><a name='toc9' id='toc9'></a>What should I do if I get an error when launching arduino.exe on Windows?</h3>
|
||||
<p>If you get an error when double-clicking the arduino.exe executable on Windows, for example:
|
||||
</p>
|
||||
<p class='vspace'></p><p><code>Arduino has encountered a problem and needs to close.</code>
|
||||
</p>
|
||||
<p class='vspace'></p><p>you'll need to launch Arduino using the run.bat file. Please be patient, the Arduino environment may take some time to open.
|
||||
</p>
|
||||
<p class='vspace'></p><h3><a name='toc10' id='toc10'></a>Why won't Arduino run on old versions of Mac OS X?</h3>
|
||||
<p>If you get an error like this:
|
||||
</p>
|
||||
<p class='vspace'></p><pre>Link (dyld) error:
|
||||
|
||||
dyld: /Applications/arduino-0004/Arduino 04.app/Contents/MacOS/Arduino Undefined symbols:
|
||||
/Applications/arduino-0004/librxtxSerial.jnilib undefined reference to _printf$LDBL128 expected to be defined in /usr/lib/libSystem.B.dylib
|
||||
</pre>
|
||||
<p class='vspace'></p><p>you probably need to upgrade to Max OS X 10.3.9 or later. Older versions have incompatible versions of some system libraries.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Thanks to Gabe462 for the report.
|
||||
</p>
|
||||
<p class='vspace'></p><h3><a name='toc11' id='toc11'></a>What do I do if I get an <span class='wikiword'>UnsatisfiedLinkError</span> error (about native library librxtxSerial.jnilib) when launching Arduino?</h3>
|
||||
<p>If you get an error like this when launching Arduino:
|
||||
</p>
|
||||
<p class='vspace'></p><p><code>Uncaught exception in main method: java.<span class='wikiword'>lang.UnsatisfiedLinkError</span>: Native Library /Users/anu/Desktop/arduino-0002/librxtxSerial.jnilib already loaded in another classloader</code>
|
||||
</p>
|
||||
<p class='vspace'></p><p>you probably have an old version of the communications library lying around. Search for comm.jar or jcl.jar in /System/Library/<span class='wikiword'>Frameworks/JavaVM</span>.framework/ or in directories in your CLASSPATH or PATH environment variables. (reported by Anurag Sehgal)
|
||||
</p>
|
||||
<p class='vspace'></p><h3><a name='toc12' id='toc12'></a>What about the error "Could not find the main class."?</h3>
|
||||
<p>If you get this error when launching Arduino:
|
||||
</p>
|
||||
<p class='vspace'></p><p><code>Java Virtual Machine Launcher: Could not find the main class. Program will exit.</code>
|
||||
</p>
|
||||
<p class='vspace'></p><p>make sure that you correctly extracted the contents of the Arduino .zip file - in particular that the <strong>lib</strong> directory is directly inside of the Arduino directory and contains the file <strong>pde.jar</strong>.
|
||||
</p>
|
||||
<p class='vspace'></p><h3><a name='toc13' id='toc13'></a>What can I do about cygwin conflicts on Windows?</h3>
|
||||
<p>If you already have cygwin installed on your machine, you might get an error like this when you try to compile a sketch in Arduino:
|
||||
</p>
|
||||
<p class='vspace'></p><p><code> 6 [main] ? (3512) C:\Dev\arduino-0006\tools\avr\bin\avr-gcc.exe: *** fatal error - C:\Dev\arduino-0006\tools\avr\bin\avr-gcc.exe: *** system shared memory version mismatch detected - 0x75BE0084/0x75BE009C.</code>
|
||||
</p>
|
||||
<p class='vspace'></p><p><code>This problem is probably due to using incompatible versions of the cygwin DLL.</code>
|
||||
</p>
|
||||
<p class='vspace'></p><p><code>Search for cygwin1.dll using the Windows Start->Find/Search facility and delete all but the most recent version. The most recent version *should* reside in x:\cygwin\bin, where 'x' is the drive on which you have installed the cygwin distribution. Rebooting is also suggested if you are unable to find another cygwin DLL.</code>
|
||||
</p>
|
||||
<p class='vspace'></p><p>If so, first make sure that you don't have cygwin running when you use Arduino. If that doesn't help, you can try deleting cygwin1.dll from the Arduino directory and replacing it with the cygwin1.dll from your existing cygwin install (probably in c:\cygwin\bin).
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Thanks to karlcswanson for the suggestion.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><h3><a name='toc14' id='toc14'></a>Why does do the Arduino software and the Tools menu take a long time to open (on Windows)?</h3>
|
||||
<p>If the Arduino software takes a long time to start up and appears to freeze when you try to open the Tools menu, there by a conflict with another device on your system. The Arduino software, on startup and when you open the Tools menu, tries to get a list of all the COM ports on your computer. It's possible that a COM port created by one of the devices on your computer slows down this process. Take a look in the Device Manager. Try disabling the devices that provide COM ports (e.g. Bluetooth devices).
|
||||
</p>
|
||||
<p class='vspace'></p><p><a name='serialport' id='serialport'></a>
|
||||
</p><h3><a name='toc15' id='toc15'></a>Why doesn't my board show in the Tools | Serial Port menu ?</h3>
|
||||
<p>If you're using a USB Arduino board, make sure you installed the FTDI drivers (see the <a class='wikilink' href='Guide_Howto.html'>Howto</a> for directions). If you're using a USB-to-Serial adapter with a serial board, make sure you installed its drivers.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Make sure that the board is plugged in: the serial port menu refreshes whenever you open the <strong>Tools</strong> menu, so if you just unplugged the board, it won't be in the menu.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Check that you're not running any programs that scan all serial ports, like PDA sync applications, Bluetooth-USB drivers (e.g. <span class='wikiword'>BlueSoleil</span>), virtual daemon tools, etc.
|
||||
</p>
|
||||
<p class='vspace'></p><p>On Windows, the COM port assigned to the board may be too high. From zeveland:
|
||||
</p>
|
||||
<p class='vspace'></p><p>"One little note if you aren't able to export and your USB board is trying to use a high COM port number: try changing the FTDI chip's COM port assignment to a lower one.
|
||||
</p>
|
||||
<p class='vspace'></p><p>"I had a bunch of virtual COM ports set up for Bluetooth so the board was set to use <span class='wikiword'>COM17</span>. The IDE wasn't able to find the board so I deleted the other virtual ports in Control Panel (on XP) and moved the FTDI's assignment down to <span class='wikiword'>COM2</span>. Make sure to set Arduino to use the new port and good luck."
|
||||
</p>
|
||||
<p class='vspace'></p><p>On the Mac, if you have an old version of the FTDI drivers, you may need to remove them and reinstall the latest version. See <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1143197735' rel='nofollow'>this forum thread for directions</a> (thanks to gck).
|
||||
</p>
|
||||
<p class='vspace'></p><h3><a name='toc16' id='toc16'></a>What if I get a gnu.<span class='wikiword'>io.PortInUseException</span> when uploading code or using the serial monitor (on the Mac)?</h3>
|
||||
<pre>
|
||||
Error inside Serial.<init>()
|
||||
gnu.io.PortInUseException: Unknown Application
|
||||
at gnu.io.CommPortIdentifier.open(CommPortIdentifier.java:354)
|
||||
at processing.app.Serial.<init>(Serial.java:127)
|
||||
at processing.app.Serial.<init>(Serial.java:72)
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p>This probably means that the port is actually in use by another application. Please make sure that you're not running other programs that access serial or USB ports, like PDA sync application, bluetooth device managers, certain firewalls, etc. Also, note that some programs (e.g. Max/MSP) keep the serial port open even when not using it - you may to need to close any patches that use the serial port or quit the application entirely.
|
||||
</p>
|
||||
<p class='vspace'></p><p>If you get this error with Arduino 0004 or earlier, or with Processing, you'll need to run the <code>macosx_setup.command</code>, and then restart your computer. Arduino 0004 includes a modified version of this script that all users need to run (even those who ran the one that came with Arduino 0003). You may also need to delete the contents of the <strong>/var/spool/uucp</strong> directory.
|
||||
</p>
|
||||
<p class='vspace'></p><h3><a name='toc17' id='toc17'></a>I'm having trouble with the FTDI USB drivers.</h3>
|
||||
<p>Try installing the <a class='urllink' href='http://www.ftdichip.com/Drivers/VCP.htm' rel='nofollow'>latest drivers</a> from FTDI or contacting their support at <a class='urllink' href='mailto:support1@ftdichip.com' rel='nofollow'>support1@ftdichip.com</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a name='sketchstart' id='sketchstart'></a>
|
||||
</p><h3><a name='toc18' id='toc18'></a>Why doesn't my sketch start when I power up or reset the Arduino board?</h3>
|
||||
<p>Most likely because you are sending serial data to the board when it firsts turns on. During the first few seconds, the bootloader (a program pre-burned onto the chip on the board) listens for the computer to send it a new sketch to be uploaded to the board. After a few seconds without communication, the bootloader will time out and start the sketch that's already on the board. If you continue to send data to the bootloader, it will never time out and your sketch will never start. You'll either need to find a way to stop serial data from arriving for the first few seconds when the board powers (e.g. by enabling the chip that sends the data from within your setup() function) or burn your sketch onto the board with an <a class='wikilink' href='http://arduino.cc/en/Hacking/Programmer'>external programmer</a>, replacing the bootloader.
|
||||
</p>
|
||||
<p class='vspace'></p><h3><a name='toc19' id='toc19'></a>Why does my sketch appear to upload successfully but not do anything?</h3>
|
||||
<p>You have selected the wrong item from the Tools > Microcontroller menu. Make sure the selected microcontroller corresponds to the one on your board (either <span class='wikiword'>ATmega8</span> or <span class='wikiword'>ATmega168</span>) - the name will be written on the largest chip on the board.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Check for a noisy power supply. It's possible this could cause the chip to lose its sketch.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Alternatively, the sketch may be too big for the board. When uploading your sketch, Arduino 0004 checks if it's too big for the <span class='wikiword'>ATmega8</span>, but it bases its calculation on a 1 Kb bootloader. You may have a older bootloader that takes up 2 Kb of the 8 Kb of program space (flash) on the <span class='wikiword'>ATmega8</span> instead of the 1 Kb used by the current bootloader. If yours is bigger, only part of the sketch will be uploaded, but the software won't know, and your board will continually reset, pause, reset.
|
||||
</p>
|
||||
<p class='vspace'></p><p>If you have access to an AVR-ISP or parallel port programmer, you can burn the latest version of the bootloader to your board with the <strong>Tools | Burn Bootloader</strong> menu item. Otherwise, you can tell the Arduino environment the amount of space available for sketches by editing the upload.maximum_size variable in your preferences file (see: <a class='wikilink' href='http://arduino.cc/en/Hacking/Preferences'>instructions on finding the file</a>). Change 7168 to 6144, and the environment should correctly warn you when your sketch is too big.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a name='size' id='size'></a>
|
||||
</p><h3><a name='toc20' id='toc20'></a>How can I reduce the size of my sketch?</h3>
|
||||
<p>The <span class='wikiword'>ATmega168</span> chip on the Arduino board is cheap, but it has only 16 Kb of program code, which isn't very much (and 2 Kb is used by the bootloader).
|
||||
</p>
|
||||
<p class='vspace'></p><p>If you're using floating point, try to rewrite your code with integer math, which should save you about 2 Kb. Delete any <strong>#include</strong> statements at the top of your sketch for libraries that you're not using.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Otherwise, see if you can make your program shorter.
|
||||
</p>
|
||||
<p class='vspace'></p><p>We're always working to reduce the size of the Arduino core to leave more room for your sketches.
|
||||
</p>
|
||||
<p class='vspace'></p><h3><a name='toc21' id='toc21'></a>Why don't I get a PWM (an analog output) when I call analogWrite() on pins other than 3, 5, 6, 9, 10, or 11?</h3>
|
||||
<p>The microcontroller on the Arduino board (the <span class='wikiword'>ATmega168</span>) only supports PWM/analogWrite() on certain pins. Calling analogWrite() on any other pins will give high (5 volts) for values greater than 128 and low (0 volts) for values less than 128. (Older Arduino boards with an <span class='wikiword'>ATmega8</span> only support PWM output on pins 9, 10, and 11.)
|
||||
</p>
|
||||
<p class='vspace'></p><h3><a name='toc22' id='toc22'></a>Why do I get errors about undeclared functions or undeclared types?</h3>
|
||||
<p>The Arduino environment attempts to automatically generate prototypes for your functions, so that you can order them as you like in your sketch. This process, however, isn't perfect, and sometimes leads to obscure error messages.
|
||||
</p>
|
||||
<p class='vspace'></p><p>If you declare a custom type in your code and create a function that accepts or returns a value of that type, you'll get an error when you try to compile the sketch. This is because the automatically-generated prototype for that function will appear above the type definition.
|
||||
</p>
|
||||
<p class='vspace'></p><p>If you declare a function with a two-word return type (e.g. "unsigned int") the environment will not realize it's a function and will not create a prototype for it. That means you need to provide your own, or place the definition of the function above any calls to it.
|
||||
</p>
|
||||
<p class='vspace'></p><h3><a name='toc23' id='toc23'></a>Why do I get errors about an invalid device signature when trying to upload a sketch?</h3>
|
||||
<p>If you get an error like:
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
avrdude: Yikes! Invalid device signature.
|
||||
Double check connections and try again, or use -F to override
|
||||
this check.
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p>it can mean one of two things. Either you have the wrong board selected from the Tools > Board menu or you're not using the right version of avrdude. Arduino uses a slightly modified version of avrdude to upload sketches to the Arduino board. The standard version queries for the board's device signature in a way not understood by the bootloader, resulting in this error. Make sure you're using the version of avrdude that comes with Arduino (<a class='urllink' href='http://svn.berlios.de/wsvn/arduino/avrdude-5.4-arduino/#_avrdude-5.4-arduino_' rel='nofollow'>source code</a>).
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/en/Guide/HomePage' rel='nofollow'>Guide Home</a>
|
||||
The text of the Arduino getting started guide is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the guide are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_Troubleshooting?action=edit.html'>Edit Page</a> | <a href='Guide_Troubleshooting?action=diff.html'>Page History</a> | <a href='Guide_Troubleshooting?action=print.html' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
137
arduino-0018-linux/reference/Guide_Windows.html
Normal file
137
arduino-0018-linux/reference/Guide_Windows.html
Normal file
|
@ -0,0 +1,137 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Windows </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<h2>How To Get Arduino Running on Windows</h2>
|
||||
<p><em>This document explains how to connect your Arduino board to the computer and upload your first sketch.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>These are the steps that we'll go through:
|
||||
</p>
|
||||
<p class='vspace'></p><ol><li>Get an Arduino board and cable
|
||||
</li><li>Download the Arduino environment
|
||||
</li><li>Install the USB drivers
|
||||
</li><li>Connect the board
|
||||
</li><li>Run the Arduino environment
|
||||
</li><li>Upload a program
|
||||
</li><li>Look for the blinking LED
|
||||
</li><li>Learn to use Arduino
|
||||
</li></ol><p class='vspace'></p><h3>1 | Get an Arduino board and cable</h3>
|
||||
<p>In this tutorial, we assume you're using an Arduino Duemilanove or Diecimila. If you have another board, read the corresponding page in this getting started guide.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The Arduino is a simple board that contains everything you need to start working with electronics and microcontroller programming. This diagram illustrates the major components of an Arduino Diecimila. (The Arduino Duemilanove is almost identical.)
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/ArduinoDiecimilaComponents.jpg' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p>You also need a standard USB cable (A plug to B plug): the kind you would connect to a USB printer, for example.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>2 | Download the Arduino environment</h3>
|
||||
<p>To program the Arduino board you need the Arduino environment.
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>Download</strong>: the latest version from the <a class='wikilink' href='http://arduino.cc/en/Main/Software'>download page</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><p>When the download finishes, unzip the downloaded file. Make sure to preserve the folder structure. Double-click the folder to open it. There should be a few files and sub-folders inside.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>3 | Locate the USB drivers</h3>
|
||||
<p>If you are using a USB Arduino, you will need to install the drivers for the FTDI chip on the board. These can be found in the <code>drivers/FTDI USB Drivers</code> directory of the Arduino distribution. In the next step ("Connect the board"), you will point Window's Add New Hardware wizard to these drivers.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The latest version of the drivers can be found on the <a class='urllink' href='http://www.ftdichip.com/Drivers/VCP.htm' rel='nofollow'>FTDI website</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>4 | Connect the board</h3>
|
||||
<p>On the Diecimila, the power source is selected by the jumper between the USB and power plugs. To power the board from the USB port (good for controlling low power devices like <span class='wikiword'>LEDs</span>), place the jumper on the two pins closest to the USB plug. To power the board from an external power supply (6-12V), place the jumper on the two pins closest to the power plug. On the Duemilanove, the power source is selected automatically (there is no power selection jumper). In any case, connect the board to a USB port on your computer.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The green power LED (labelled <strong>PWR</strong>) should go on.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The Add New Hardware wizard will open. Tell it not to connect to Windows update and click next.
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/wizard1-step1.png' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p>Then select "Install from a list or specified location (Advanced)" and click next.
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/wizard1-step2.png' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p>Make sure that "Search for the best driver in these locations is checked"; uncheck "Search removable media"; check "Include this location in the search" and browse to the location you unzipped the USB drivers to in the previous step. Click next.
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/wizard1-step3.png' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p>The wizard will search for the driver and then tell you that a "USB Serial Converter" was found. Click finish.
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/wizard1-step4.png' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p>The new hardware wizard will appear again. Go through the same steps. This time, a "USB Serial Port" will be found.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>5 | Run the Arduino environment</h3>
|
||||
<p>(Mac OSX): Copy the Arduino application to your Applications directory. Double-click the Arduino application.
|
||||
</p>
|
||||
<p class='vspace'></p><p>(Windows): Open the Arduino folder and double-click the Arduino application.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>6 | Upload a program</h3>
|
||||
<p>Open the LED blink example sketch: <strong>File > Sketchbook > Examples > Digital > Blink</strong>.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Select the serial device of the Arduino board from the Tools | Serial Port menu. On Windows, this should be <code><span class='wikiword'>COM1</span></code> or <code><span class='wikiword'>COM2</span></code> for a serial Arduino board, or <code><span class='wikiword'>COM3</span></code>, <code><span class='wikiword'>COM4</span></code>, or <code><span class='wikiword'>COM5</span></code> for a USB board. To find out, open the Windows Device Mananger (in the Hardware tab of System control panel). Look for a "USB Serial Port" in the Ports section; that's the Arduino board.
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/device-manager.png' alt='' title='' /></div>
|
||||
<p class='vspace'></p><p>You'll need to select the entry in the <strong>Tools > Board</strong> menu that corresponds to your Arduino. For newer Arduino boards with an <span class='wikiword'>ATmega328</span> (check the text on the chip on the board), select <strong>Arduino Duemilanove w/ <span class='wikiword'>ATmega328</span></strong>. Previously, Arduino boards came with an <span class='wikiword'>ATmega168</span>; for those, select <strong>Arduino Diecimila or Duemilanove w/ <span class='wikiword'>ATmega168</span></strong>.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Now, simply click the "Upload" button in the environment. Wait a few seconds - you should see the RX and TX leds on the board flashing. If the upload is successful, the message "Done uploading." will appear in the status bar. (<em>Note:</em> If you have an Arduino Mini, NG, or other board, you'll need to physically present the reset button on the board immediately before pressing the upload button.)
|
||||
</p>
|
||||
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/UploadButton.png' alt='' title='' /></div>
|
||||
<p class='vspace'></p><h3>7 | Look for the blinking LED</h3>
|
||||
<p>A few seconds after the upload finishes, you should see the pin 13 (L) LED on the board start to blink (in orange). If it does, congratulations! You've gotten Arduino up-and-running.
|
||||
</p>
|
||||
<p class='vspace'></p><p>If you have problems, please see the <a class='wikilink' href='Guide_Troubleshooting.html'>troubleshooting suggestions</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>8 | Learn to use Arduino</h3>
|
||||
<ul><li><a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Examples</a>: try these example programs.
|
||||
</li><li><a class='wikilink' href='index.html'>Reference</a>: read the reference for the Arduino language.
|
||||
</li></ul><p>The text of the Arduino getting started guide is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the guide are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_Windows?action=edit.html'>Edit Page</a> | <a href='Guide_Windows?action=diff.html'>Page History</a> | <a href='Guide_Windows?action=print.html' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
86
arduino-0018-linux/reference/Guide_index.html
Normal file
86
arduino-0018-linux/reference/Guide_index.html
Normal file
|
@ -0,0 +1,86 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Getting Started </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='selflink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<h2>Getting Started with Arduino</h2>
|
||||
<p class='vspace'></p><table width='100%' border='0' cellpadding='5' cellspacing='0'><tr><td width='50%' valign='top'>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='Guide_Introduction.html'>Introduction</a>: What Arduino is and why you'd want to use it.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Installation: Step-by-step instructions for setting up the Arduino software and connecting it to an Arduino Duemilanove.
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><a class='wikilink' href='Guide_Windows.html'>Windows</a>
|
||||
</li><li><a class='wikilink' href='Guide_MacOSX.html'>Mac OS X</a>
|
||||
</li><li><a class='urllink' href='http://www.arduino.cc/playground/Learning/Linux' rel='nofollow'>Linux</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='Guide_Environment.html'>Environment</a>: Description of the Arduino development environment.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='Guide_Troubleshooting.html'>Troubleshooting</a>: Advice on what to do if things don't work.
|
||||
</p>
|
||||
<p class='vspace'></p></td><td width='50%' valign='top'>
|
||||
<p class='vspace'></p><p>Instructions for other boards:
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><a class='wikilink' href='Guide_ArduinoNano.html'>Arduino Nano</a>
|
||||
</li><li><a class='wikilink' href='Guide_ArduinoMini.html'>Arduino Mini</a>
|
||||
</li><li><a class='wikilink' href='Guide_ArduinoBT.html'>Arduino BT</a>
|
||||
</li><li><a class='wikilink' href='Guide_ArduinoLilyPad.html'>LilyPad Arduino</a>
|
||||
</li><li><a class='wikilink' href='Guide_ArduinoPro.html'>Arduino Pro</a>
|
||||
</li><li><a class='wikilink' href='Guide_ArduinoProMini.html'>Arduino Pro Mini</a>
|
||||
<p class='vspace'></p></li><li><a class='wikilink' href='Guide_ArduinoXbeeShield.html'>Xbee shield</a>
|
||||
</li><li><a class='wikilink' href='Guide_ArduinoEthernetShield.html'>Ethernet shield</a>
|
||||
</li></ul><p class='vspace'></p></td></tr></table>
|
||||
<p>The text of the Arduino getting started guide is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the guide are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='Guide_HomePage?action=edit.html'>Edit Page</a> | <a href='Guide_HomePage?action=diff.html'>Page History</a> | <a href='Guide_HomePage?action=print.html' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
83
arduino-0018-linux/reference/HighByte.html
Normal file
83
arduino-0018-linux/reference/HighByte.html
Normal file
|
@ -0,0 +1,83 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - HighByte </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>highByte()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Extracts the high-order (leftmost) byte of a word (or the second lowest byte of a larger data type).
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>highByte(x)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>x: a value of any type
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>byte
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='LowByte.html'>lowByte</a>()
|
||||
</li><li><a class='wikilink' href='WordCast.html'>word</a>()
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
192
arduino-0018-linux/reference/HomePage.html
Normal file
192
arduino-0018-linux/reference/HomePage.html
Normal file
|
@ -0,0 +1,192 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Reference </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc/">Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav">
|
||||
<p><a class='wikilink' href='Guide_index.html'>Guide</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Tutorial/HomePage'>Tutorials</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='selflink' href='index.html'>Reference</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Software'>Software</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/blog/' rel='nofollow'>Blog</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl' rel='nofollow'>Forum</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/playground/' rel='nofollow'>Playground</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='urllink' href='http://www.arduino.cc/playground/Projects/ArduinoUsers' rel='nofollow'>Exhibition</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Hacking/HomePage'>Hacking</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/FAQ'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='http://www.arduino.cc/en/Main/Buy'>Buy</a>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='selflink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h1>Arduino Reference</h1>
|
||||
<p><em>See the <strong><a class='wikilink' href='Extended.html'>extended reference</a></strong> for more advanced features of the Arduino languages.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>Arduino programs can be divided in three main parts: <em>structure</em>, <em>values</em> (variables and constants), and <em>functions</em>. The Arduino language is based on C/C++.
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
<table width='90%' border='0' cellpadding='5' cellspacing='0'><tr><td width='50%' valign='top'>
|
||||
<h2>Structure</h2>
|
||||
<p>An Arduino program run in two parts:
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li>void <a class='wikilink' href='Setup.html'>setup</a>()
|
||||
</li><li>void <a class='wikilink' href='Loop.html'>loop</a>()
|
||||
</li></ul><p class='vspace'></p><p>setup() is preparation, and loop() is execution. In the setup section, always at the top of your program, you would set <a class='wikilink' href='PinMode.html'>pinModes</a>, initialize serial communication, etc. The loop section is the code to be executed -- reading inputs, triggering outputs, etc.
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><a class='wikilink' href='VariableDeclaration.html'>Variable Declaration</a>
|
||||
</li><li><a class='wikilink' href='FunctionDeclaration.html'>Function Declaration</a>
|
||||
<ul><li><a class='wikilink' href='Void.html'>void</a>
|
||||
</li></ul></li></ul><p class='vspace'></p><h4>Control Structures</h4>
|
||||
<ul><li><a class='wikilink' href='If.html'>if</a>
|
||||
</li><li><a class='wikilink' href='Else.html'>if...else</a>
|
||||
</li><li><a class='wikilink' href='For.html'>for</a>
|
||||
</li><li><a class='wikilink' href='SwitchCase.html'>switch case</a>
|
||||
</li><li><a class='wikilink' href='While.html'>while</a>
|
||||
</li><li><a class='wikilink' href='DoWhile.html'>do... while</a>
|
||||
</li><li><a class='wikilink' href='Break.html'>break</a>
|
||||
</li><li><a class='wikilink' href='Continue.html'>continue</a>
|
||||
</li><li><a class='wikilink' href='Return.html'>return</a>
|
||||
</li></ul><p class='vspace'></p><h4>Further Syntax</h4>
|
||||
<ul><li><a class='wikilink' href='SemiColon.html'>;</a> (semicolon)
|
||||
</li><li><a class='wikilink' href='Braces.html'>{}</a> (curly braces)
|
||||
</li><li><a class='wikilink' href='Comments.html'>//</a> (single line comment)
|
||||
</li><li><a class='wikilink' href='Comments.html'>/* */</a> (multi-line comment)
|
||||
</li></ul><p class='vspace'></p><h4>Arithmetic Operators</h4>
|
||||
<ul><li><a class='wikilink' href='Arithmetic.html'>plus</a> (addition)
|
||||
</li><li><a class='wikilink' href='Arithmetic.html'>-</a> (subtraction)
|
||||
</li><li><a class='wikilink' href='Arithmetic.html'>*</a> (multiplication)
|
||||
</li><li><a class='wikilink' href='Arithmetic.html'>/</a> (division)
|
||||
</li><li><a class='wikilink' href='Modulo.html'>%</a> (modulo)
|
||||
</li></ul><p class='vspace'></p><h4>Comparison Operators</h4>
|
||||
<ul><li><a class='wikilink' href='If.html'>==</a> (equal to)
|
||||
</li><li><a class='wikilink' href='If.html'>!=</a> (not equal to)
|
||||
</li><li><a class='wikilink' href='If.html'><</a> (less than)
|
||||
</li><li><a class='wikilink' href='If.html'>></a> (greater than)
|
||||
</li><li><a class='wikilink' href='If.html'><=</a> (less than or equal to)
|
||||
</li><li><a class='wikilink' href='If.html'>>=</a> (greater than or equal to)
|
||||
</li></ul><p class='vspace'></p><h4>Boolean Operators</h4>
|
||||
<ul><li><a class='wikilink' href='Boolean.html'>&&</a> (and)
|
||||
</li><li><a class='wikilink' href='Boolean.html'>||</a> (or)
|
||||
</li><li><a class='wikilink' href='Boolean.html'>!</a> (not)
|
||||
</li></ul><p class='vspace'></p><h4>Compound Operators</h4>
|
||||
<ul><li><a class='wikilink' href='Increment.html'>++</a> (increment)
|
||||
</li><li><a class='wikilink' href='Increment.html'>--</a> (decrement)
|
||||
</li><li><a class='wikilink' href='IncrementCompound.html'>+=</a> (compound addition)
|
||||
</li><li><a class='wikilink' href='IncrementCompound.html'>-=</a> (compound subtraction)
|
||||
</li><li><a class='wikilink' href='IncrementCompound.html'>*=</a> (compound multiplication)
|
||||
</li><li><a class='wikilink' href='IncrementCompound.html'>/=</a> (compound division)
|
||||
</li></ul><p class='vspace'></p><h2>Variables</h2>
|
||||
<p>Variables are expressions that you can use in programs to store values, such as a sensor reading from an analog pin.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Constants</h4>
|
||||
<p>Constants are particular values with specific meanings.
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><a class='wikilink' href='Constants.html'>HIGH</a> | <a class='wikilink' href='Constants.html'>LOW</a>
|
||||
</li><li><a class='wikilink' href='Constants.html'>INPUT</a> | <a class='wikilink' href='Constants.html'>OUTPUT</a>
|
||||
<p class='vspace'></p></li><li><a class='wikilink' href='IntegerConstants.html'>Integer Constants</a>
|
||||
</li></ul><p class='vspace'></p><h4>Data Types</h4>
|
||||
<p>Variables can have various types, which are described below.
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><a class='wikilink' href='BooleanVariables.html'>boolean</a>
|
||||
</li><li><a class='wikilink' href='Char.html'>char</a>
|
||||
</li><li><a class='wikilink' href='Byte.html'>byte</a>
|
||||
</li><li><a class='wikilink' href='Int.html'>int</a>
|
||||
</li><li><a class='wikilink' href='UnsignedInt.html'>unsigned int</a>
|
||||
</li><li><a class='wikilink' href='Long.html'>long</a>
|
||||
</li><li><a class='wikilink' href='UnsignedLong.html'>unsigned long</a>
|
||||
</li><li><a class='wikilink' href='Float.html'>float</a>
|
||||
</li><li><a class='wikilink' href='Double.html'>double</a>
|
||||
</li><li><a class='wikilink' href='String.html'>string</a>
|
||||
</li><li><a class='wikilink' href='Array.html'>array</a>
|
||||
</li></ul><p class='vspace'></p><h2>Reference</h2>
|
||||
<ul><li><a class='wikilink' href='ASCIIchart.html'>ASCII chart</a>
|
||||
</li></ul><p class='vspace'></p></td><td width='50%' valign='top'>
|
||||
<h2>Functions</h2>
|
||||
<p><strong>Digital I/O</strong>
|
||||
</p><ul><li><a class='wikilink' href='PinMode.html'>pinMode</a>(pin, mode)
|
||||
</li><li><a class='wikilink' href='DigitalWrite.html'>digitalWrite</a>(pin, value)
|
||||
</li><li>int <a class='wikilink' href='DigitalRead.html'>digitalRead</a>(pin)
|
||||
</li></ul><p class='vspace'></p><p><strong>Analog I/O</strong>
|
||||
</p><ul><li>int <a class='wikilink' href='AnalogRead.html'>analogRead</a>(pin)
|
||||
</li><li><a class='wikilink' href='AnalogWrite.html'>analogWrite</a>(pin, value) - <em>PWM</em>
|
||||
</li></ul><p class='vspace'></p><p><strong>Advanced I/O</strong>
|
||||
</p><ul><li><a class='wikilink' href='ShiftOut.html'>shiftOut</a>(dataPin, clockPin, bitOrder, value)
|
||||
</li><li>unsigned long <a class='wikilink' href='PulseIn.html'>pulseIn</a>(pin, value)
|
||||
</li></ul><p class='vspace'></p><p><strong>Time</strong>
|
||||
</p><ul><li>unsigned long <a class='wikilink' href='Millis.html'>millis</a>()
|
||||
</li><li><a class='wikilink' href='Delay.html'>delay</a>(ms)
|
||||
</li><li><a class='wikilink' href='DelayMicroseconds.html'>delayMicroseconds</a>(us)
|
||||
</li></ul><p class='vspace'></p><p><strong>Math</strong>
|
||||
</p><ul><li><a class='wikilink' href='Min.html'>min</a>(x, y)
|
||||
</li><li><a class='wikilink' href='Max.html'>max</a>(x, y)
|
||||
</li><li><a class='wikilink' href='Abs.html'>abs</a>(x)
|
||||
</li><li><a class='wikilink' href='Constrain.html'>constrain</a>(x, a, b)
|
||||
</li></ul><p class='vspace'></p><p><strong>Random Numbers</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><a class='wikilink' href='RandomSeed.html'>randomSeed</a>(seed)
|
||||
</li><li>long <a class='wikilink' href='Random.html'>random</a>(max)
|
||||
</li><li>long <a class='wikilink' href='Random.html'>random</a>(min, max)
|
||||
</li></ul><p class='vspace'></p><p><strong>Serial Communication</strong>
|
||||
</p>
|
||||
<p class='vspace'></p><p>Used for communication between the Arduino board and a computer or other devices. This communication happens via the Arduino board's serial or USB connection and on digital pins 0 (RX) and 1 (TX). Thus, if you use these functions, <em>you cannot also use pins 0 and 1 for digital i/o.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><a class='wikilink' href='Serial_Begin.html'>Serial.begin</a>(speed)
|
||||
</li><li>int <a class='wikilink' href='Serial_Available.html'>Serial.available</a>()
|
||||
</li><li>int <a class='wikilink' href='Serial_Read.html'>Serial.read</a>()
|
||||
</li><li><a class='wikilink' href='Serial_Flush.html'>Serial.flush</a>()
|
||||
</li><li><a class='wikilink' href='Serial_Print.html'>Serial.print</a>(data)
|
||||
</li><li><a class='wikilink' href='Serial_Println.html'>Serial.println</a>(data)
|
||||
</li></ul><p class='vspace'></p><p><br clear='all' />
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>Didn't find something?</strong> Check the <a class='wikilink' href='Extended.html'>extended reference</a>.
|
||||
</p>
|
||||
<p class='vspace'></p></td></tr></table>
|
||||
<p><a class='selflink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='RecentChanges.html'>Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
110
arduino-0018-linux/reference/If.html
Normal file
110
arduino-0018-linux/reference/If.html
Normal file
|
@ -0,0 +1,110 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - If </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>if (conditional) and ==, !=, <, > (comparison operators)</h2>
|
||||
<p><strong><code>if</code></strong>, which is used in conjunction with a comparison operator, tests whether a certain condition has been reached, such as an input being above a certain number. The format for an if test is:
|
||||
</p>
|
||||
<p class='vspace'></p><pre>if (someVariable > 50)
|
||||
{
|
||||
// do something here
|
||||
}
|
||||
</pre>
|
||||
<p class='vspace'></p><p>The program tests to see if someVariable is greater than 50. If it is, the program takes a particular action. Put another way, if the statement in parentheses is true, the statements inside the brackets are run. If not, the program skips over the code.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The brackets may be omitted after an <em>if</em> statement. If this is done, the next line (defined by the semicolon) becomes the only conditional statement.
|
||||
</p><pre>
|
||||
|
||||
if (x > 120) digitalWrite(LEDpin, HIGH);
|
||||
|
||||
if (x > 120)
|
||||
digitalWrite(LEDpin, HIGH);
|
||||
|
||||
if (x > 120){ digitalWrite(LEDpin, HIGH); }
|
||||
|
||||
if (x > 120){
|
||||
digitalWrite(LEDpin1, HIGH);
|
||||
digitalWrite(LEDpin2, HIGH);
|
||||
} // all are correct
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p>The statements being evaluated inside the parentheses require the use of one or more operators:
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Comparison Operators:</h3>
|
||||
<pre> <strong>x == y</strong> (x is equal to y)
|
||||
<strong>x != y</strong> (x is not equal to y)
|
||||
<strong>x < y</strong> (x is less than y)
|
||||
<strong>x > y</strong> (x is greater than y)
|
||||
<strong>x <= y</strong> (x is less than or equal to y)
|
||||
<strong>x >= y</strong> (x is greater than or equal to y)
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Warning: </h4>
|
||||
<p>Beware of accidentally using the single equal sign (e.g.<code> if (x = 10)</code> ). The single equal sign is the assignment operator, and sets x to 10 (puts the value 10 into the variable x). Instead use the double equal sign (e.g.<code> if (x == 10) </code>), which is the comparison operator, and tests <em>whether</em> x is equal to 10 or not. The latter statement is only true if x equals 10, but the former statement will always be true.
|
||||
</p>
|
||||
<p class='vspace'></p><p>This is because C evaluates the statement <code> if (x=10) </code> as follows: 10 is assigned to x (remember that the single equal sign is the <a class='wikilink' href='Assignment.html'>assignment operator</a>), so x now contains 10. Then the 'if' conditional evaluates 10, which always evaluates to TRUE, since any non-zero number evaluates to TRUE. Consequently, <code>if (x = 10)</code> will always evaluate to TRUE, which is not the desired result when using an 'if' statement. Additionally, the variable x will be set to 10, which is also not a desired action.
|
||||
</p>
|
||||
<p class='vspace'></p><p><strong>if</strong> can also be part of a branching control structure using the <a class='wikilink' href='Else.html'>if...else</a>] construction.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
84
arduino-0018-linux/reference/Include.html
Normal file
84
arduino-0018-linux/reference/Include.html
Normal file
|
@ -0,0 +1,84 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Include </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>#include</h2>
|
||||
<p><strong>#include</strong> is used to include outside libraries in your sketch. This gives the programmer access to a large group of standard C libraries (groups of pre-made functions), and also libraries written especially for Arduino.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The main reference page for AVR C libraries (AVR is a reference to the Atmel chips on which the Arduino is based) is <a class='urllink' href='http://www.nongnu.org/avr-libc/user-manual/modules.html' rel='nofollow'>here.</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p>Note that <strong>#include</strong>, similar to <strong>#define</strong>, has no semicolon terminator, and the compiler will yield cryptic error messages if you add one.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<p>This example includes a library that is used to put data into the program space <em>flash</em> instead of <em>ram</em>. This saves the ram space for dynamic memory needs and makes large lookup tables more practical.
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
prog_uint16_t myConstants[] PROGMEM = {0, 21140, 702 , 9128, 0, 25764, 8456,
|
||||
0,0,0,0,0,0,0,0,29810,8968,29762,29762,4500};
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
93
arduino-0018-linux/reference/Increment.html
Normal file
93
arduino-0018-linux/reference/Increment.html
Normal file
|
@ -0,0 +1,93 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Increment </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>++ (increment) / -- (decrement)</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Increment or decrement a variable
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<pre>
|
||||
x++; // increment x by one and returns the old value of x
|
||||
++x; // increment x by one and returns the new value of x
|
||||
|
||||
x-- ; // decrement x by one and returns the old value of x
|
||||
--x ; // decrement x by one and returns the new value of x
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>x: an integer or long (possibly unsigned)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>The original or newly incremented / decremented value of the variable.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Examples</h4>
|
||||
<pre>x = 2;
|
||||
y = ++x; // x now contains 3, y contains 3
|
||||
y = x--; // x contains 2 again, y still contains 3
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<p><a class='wikilink' href='Arithmetic.html'>+=</a><br /><a class='wikilink' href='Arithmetic.html'>-=</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
92
arduino-0018-linux/reference/IncrementCompound.html
Normal file
92
arduino-0018-linux/reference/IncrementCompound.html
Normal file
|
@ -0,0 +1,92 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - IncrementCompound </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>+= , -= , *= , /= </h2>
|
||||
<h4>Description</h4>
|
||||
<p>Perform a mathematical operation on a variable with another constant or variable. The += (et al) operators are just a convenient shorthand for the expanded syntax, listed below.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<pre>
|
||||
x += y; // equivalent to the expression x = x + y;
|
||||
x -= y; // equivalent to the expression x = x - y;
|
||||
x *= y; // equivalent to the expression x = x * y;
|
||||
x /= y; // equivalent to the expression x = x / y;
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>x: any variable type
|
||||
</p>
|
||||
<p class='vspace'></p><p>y: any variable type or constant
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Examples</h4>
|
||||
<pre>x = 2;
|
||||
x += 4; // x now contains 6
|
||||
x -= 3; // x now contains 3
|
||||
x *= 10; // x now contains 30
|
||||
x /= 2; // x now contains 15
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
101
arduino-0018-linux/reference/Int.html
Normal file
101
arduino-0018-linux/reference/Int.html
Normal file
|
@ -0,0 +1,101 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Int </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>int</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Integers are your primary datatype for number storage, and store a 2 byte value. This yields a range of -32,768 to 32,767 (minimum value of -2^15 and a maximum value of (2^15) - 1).
|
||||
</p>
|
||||
<p class='vspace'></p><p>Int's store negative numbers with a technique called <a class='urllink' href='http://en.wikipedia.org/wiki/2%27s_complement' rel='nofollow'>2's complement math.</a> The highest bit, sometimes refered to as the "sign" bit, flags the number as a negative number. The rest of the bits are inverted and 1 is added.
|
||||
</p>
|
||||
<p class='vspace'></p><p>The Arduino takes care of dealing with negative numbers for you, so that arithmetic operations work transparently in the expected manner. There can be an unexpected complication in dealing with the <a class='wikilink' href='Bitshift.html'>bitshift right operator (>>)</a> however.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre> int ledPin = 13;
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<pre> int var = val;
|
||||
</pre>
|
||||
<p class='vspace'></p><ul><li>var - your int variable name
|
||||
</li><li>val - the value you assign to that variable
|
||||
</li></ul><p class='vspace'></p><h4>Coding Tip</h4>
|
||||
<p>When variables are made to exceed their maximum capacity they "roll over" back to their minimum capacitiy, note that this happens in both directions.
|
||||
</p>
|
||||
<p class='vspace'></p><pre> int x
|
||||
x = -32,768;
|
||||
x = x - 1; // x now contains 32,767 - rolls over in neg. direction
|
||||
|
||||
x = 32,767;
|
||||
x = x + 1; // x now contains -32,768 - rolls over
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>See Also</h4>
|
||||
<ul><li><a class='wikilink' href='Byte.html'>byte</a>
|
||||
</li><li><a class='wikilink' href='UnsignedInt.html'>unsigned int</a>
|
||||
</li><li><a class='wikilink' href='Long.html'>long</a>
|
||||
</li><li><a class='wikilink' href='UnsignedLong.html'>unsigned long</a>
|
||||
</li><li><a class='wikilink' href='IntegerConstants.html'>Integer Constants</a>
|
||||
</li><li><a class='urllink' href='VariableDeclaration.html' rel='nofollow'>Variable Declaration</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
82
arduino-0018-linux/reference/IntCast.html
Normal file
82
arduino-0018-linux/reference/IntCast.html
Normal file
|
@ -0,0 +1,82 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - IntCast </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>int()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Converts a value to the <a class='wikilink' href='Int.html'>int</a> data type.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Syntax</h4>
|
||||
<p>int(x)
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>x: a value of any type
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>int
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='Int.html'>int</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
133
arduino-0018-linux/reference/IntegerConstants.html
Normal file
133
arduino-0018-linux/reference/IntegerConstants.html
Normal file
|
@ -0,0 +1,133 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - IntegerConstants </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Integer Constants</h2>
|
||||
<p>Integer constants are numbers used directly in a sketch, like <code>123</code>. By default, these numbers are treated as <a class='wikilink' href='Int.html'>int</a>'s but you can change this with the U and L modifiers (see below).
|
||||
</p>
|
||||
<p class='vspace'></p><p>Normally, integer constants are treated as base 10 (decimal) integers, but special notation (formatters) may be used to enter numbers in other bases.
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
Base Example Formatter Comment
|
||||
|
||||
10 (decimal) 123 none
|
||||
|
||||
2 (binary) B1111011 leading 'B' only works with 8 bit values (0 to 255)
|
||||
characters 0-1 valid
|
||||
|
||||
8 (octal) 0173 leading "0" characters 0-7 valid
|
||||
|
||||
16 (hexadecimal) 0x7B leading "0x" characters 0-9, A-F, a-f valid
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><strong>Decimal</strong> is base 10. This is the common-sense math with which you are acquainted. Constants without other prefixes are assumed to be in decimal format.
|
||||
</p>
|
||||
<p class='vspace'></p>Example:<pre>
|
||||
101 // same as 101 decimal ((1 * 10^2) + (0 * 10^1) + 1)
|
||||
</pre>
|
||||
<p><br />
|
||||
<strong>Binary</strong> is base two. Only characters 0 and 1 are valid.
|
||||
</p>
|
||||
<p class='vspace'></p>Example:<pre>
|
||||
B101 // same as 5 decimal ((1 * 2^2) + (0 * 2^1) + 1)
|
||||
</pre>
|
||||
<p>The binary formatter only works on bytes (8 bits) between 0 (B0) and 255 (B11111111). If it is convenient to input an int (16 bits) in binary form you can do it a two-step procedure such as:
|
||||
</p>
|
||||
<p class='vspace'></p><pre>
|
||||
myInt = (B11001100 * 256) + B10101010; // B11001100 is the high byte
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><p><strong>Octal</strong> is base eight. Only characters 0 through 7 are valid. Octal values are indicated by the prefix "0"
|
||||
</p>
|
||||
<p class='vspace'></p><p>Example:
|
||||
</p><pre>
|
||||
0101 // same as 65 decimal ((1 * 8^2) + (0 * 8^1) + 1)
|
||||
</pre><div class='indent'>Warning
|
||||
</div><div class='indent'>It is possible to generate a hard-to-find bug by (unintentionally) including a leading zero before a constant and having the compiler unintentionally interpret your constant as octal.
|
||||
</div><p><br />
|
||||
<strong>Hexadecimal (or hex)</strong> is base sixteen. Valid characters are 0 through 9 and letters A through F; A has the value 10, B is 11, up to F, which is 15. Hex values are indicated by the prefix "0x". Note that A-F may be syted in upper or lower case (a-f).
|
||||
</p>
|
||||
<p class='vspace'></p><p>Example:
|
||||
</p><pre>
|
||||
0x101 // same as 257 decimal ((1 * 16^2) + (0 * 16^1) + 1)
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>U & L formatters</h4>
|
||||
<p>By default, an integer constant is treated as an <a class='wikilink' href='Int.html'>int</a> with the attendant limitations in values. To specify an integer constant with another data type, follow it with:
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li>a 'u' or 'U' to force the constant into an unsigned data format. Example: <code>33u</code>
|
||||
</li><li>a 'l' or 'L' to force the constant into a long data format. Example: <code>100000L</code>
|
||||
</li><li>a 'ul' or 'UL' to force the constant into an unsigned long constant. Example: <code>32767ul</code>
|
||||
</li></ul><p><br />
|
||||
</p>
|
||||
<p class='vspace'></p><h4>See also</h4>
|
||||
<ul><li><a class='wikilink' href='Constants.html'>constants</a>
|
||||
</li><li><a class='wikilink' href='Define.html'>#define</a>
|
||||
</li><li><a class='wikilink' href='Byte.html'>byte</a>
|
||||
</li><li><a class='wikilink' href='Int.html'>int</a>
|
||||
</li><li><a class='wikilink' href='UnsignedInt.html'>unsigned int</a>
|
||||
</li><li><a class='wikilink' href='Long.html'>long</a>
|
||||
</li><li><a class='wikilink' href='UnsignedLong.html'>unsigned long</a>
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
94
arduino-0018-linux/reference/Interrupts.html
Normal file
94
arduino-0018-linux/reference/Interrupts.html
Normal file
|
@ -0,0 +1,94 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Interrupts </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>interrupts()</h2>
|
||||
<h4>Description</h4>
|
||||
<p>Re-enables interrupts (after they've been disabled by <a class='wikilink' href='NoInterrupts.html'>noInterrupts</a>()). Interrupts allow certain important tasks to happen in the background and are enabled by default. Some functions will not work while interrupts are disabled, and incoming communication may be ignored. Interrupts can slightly disrupt the timing of code, however, and may be disabled for particularly critical sections of code.
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Parameters</h4>
|
||||
<p>None
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Returns</h4>
|
||||
<p>None
|
||||
</p>
|
||||
<p class='vspace'></p><h4>Example</h4>
|
||||
<pre>
|
||||
void setup() {}
|
||||
|
||||
void loop()
|
||||
{
|
||||
noInterrupts();
|
||||
// critical, time-sensitive code here
|
||||
interrupts();
|
||||
// other code here
|
||||
}
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p><h4>See Also</h4>
|
||||
<ul><li><a class='wikilink' href='NoInterrupts.html'>noInterrupts</a>()
|
||||
</li><li><a class='wikilink' href='AttachInterrupt.html'>attachInterrupt</a>()
|
||||
</li><li><a class='wikilink' href='DetachInterrupt.html'>detachInterrupt</a>()
|
||||
</li></ul><p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
275
arduino-0018-linux/reference/Keywords.html
Normal file
275
arduino-0018-linux/reference/Keywords.html
Normal file
|
@ -0,0 +1,275 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Keywords </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://www.arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://www.arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://www.arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://www.arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='wikilink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Board.html'>Board</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Keywords</h2>
|
||||
<p>Keywords are constants, variables and function names that are defined as part of the Arduino language. Avoid using keywords for variable names.
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
<table width='90%' border='0' cellpadding='5' cellspacing='0'><tr><td width='33%' valign='top'>
|
||||
<pre>
|
||||
# Constants
|
||||
|
||||
HIGH
|
||||
LOW
|
||||
INPUT
|
||||
OUTPUT
|
||||
SERIAL
|
||||
DISPLAY
|
||||
PI
|
||||
HALF_PI
|
||||
TWO_PI
|
||||
LSBFIRST
|
||||
MSBFIRST
|
||||
CHANGE
|
||||
FALLING
|
||||
RISING
|
||||
false
|
||||
true
|
||||
null
|
||||
|
||||
# Port Variables & Constants
|
||||
|
||||
DDRB
|
||||
PINB
|
||||
PORTB
|
||||
PB0
|
||||
PB1
|
||||
PB2
|
||||
PB3
|
||||
PB4
|
||||
PB5
|
||||
PB6
|
||||
PB7
|
||||
|
||||
DDRC
|
||||
PINC
|
||||
PORTC
|
||||
PC0
|
||||
PC1
|
||||
PC2
|
||||
PC3
|
||||
PC4
|
||||
PC5
|
||||
PC6
|
||||
PC7
|
||||
|
||||
DDRD
|
||||
PIND
|
||||
PORTD
|
||||
PD0
|
||||
PD1
|
||||
PD2
|
||||
PD3
|
||||
PD4
|
||||
PD5
|
||||
PD6
|
||||
PD7
|
||||
|
||||
# Datatypes
|
||||
|
||||
boolean
|
||||
byte
|
||||
char
|
||||
class
|
||||
default
|
||||
do
|
||||
double
|
||||
int
|
||||
long
|
||||
|
||||
</pre></td><td width='33%' valign='top'>
|
||||
<pre>
|
||||
private
|
||||
protected
|
||||
public
|
||||
return
|
||||
short
|
||||
signed
|
||||
static
|
||||
switch
|
||||
throw
|
||||
try
|
||||
unsigned
|
||||
void
|
||||
|
||||
# Other
|
||||
|
||||
abs
|
||||
acos
|
||||
+=
|
||||
+
|
||||
[]
|
||||
asin
|
||||
=
|
||||
atan
|
||||
atan2
|
||||
&
|
||||
|
|
||||
boolean
|
||||
byte
|
||||
case
|
||||
ceil
|
||||
char
|
||||
char
|
||||
class
|
||||
,
|
||||
//
|
||||
?:
|
||||
constrain
|
||||
cos
|
||||
{}
|
||||
--
|
||||
default
|
||||
delay
|
||||
delayMicroseconds
|
||||
/
|
||||
/**
|
||||
.
|
||||
else
|
||||
==
|
||||
exp
|
||||
false
|
||||
float
|
||||
float
|
||||
floor
|
||||
for
|
||||
<
|
||||
<=
|
||||
HALF_PI
|
||||
if
|
||||
++
|
||||
!=
|
||||
int
|
||||
<<
|
||||
<
|
||||
<=
|
||||
log
|
||||
&&
|
||||
!
|
||||
||
|
||||
|
||||
|
||||
</pre>
|
||||
<p class='vspace'></p></td><td width='33%' valign='top'>
|
||||
<p class='vspace'></p><pre>
|
||||
|
||||
loop
|
||||
max
|
||||
millis
|
||||
min
|
||||
-
|
||||
%
|
||||
/*
|
||||
*
|
||||
new
|
||||
null
|
||||
()
|
||||
PI
|
||||
return
|
||||
>>
|
||||
;
|
||||
Serial
|
||||
Setup
|
||||
sin
|
||||
sq
|
||||
sqrt
|
||||
-=
|
||||
switch
|
||||
tan
|
||||
this
|
||||
true
|
||||
TWO_PI
|
||||
void
|
||||
while
|
||||
Serial
|
||||
begin
|
||||
read
|
||||
print
|
||||
write
|
||||
println
|
||||
available
|
||||
digitalWrite
|
||||
digitalRead
|
||||
pinMode
|
||||
analogRead
|
||||
analogWrite
|
||||
attachInterrupts
|
||||
detachInterrupts
|
||||
beginSerial
|
||||
serialWrite
|
||||
serialRead
|
||||
serialAvailable
|
||||
printString
|
||||
printInteger
|
||||
printByte
|
||||
printHex
|
||||
printOctal
|
||||
printBinary
|
||||
printNewline
|
||||
pulseIn
|
||||
shiftOut
|
||||
|
||||
</pre></td></tr></table>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://www.arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
120
arduino-0018-linux/reference/Libraries.html
Normal file
120
arduino-0018-linux/reference/Libraries.html
Normal file
|
@ -0,0 +1,120 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Arduino - Libraries </title>
|
||||
<link rel='stylesheet' href='arduino.css' type='text/css' />
|
||||
<meta name="verify-v1" content="TtxFIEJAB6zdJ509wLxjnapQzKAMNm9u0Wj4ho6wxIY=" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="page">
|
||||
<!--PageHeaderFmt-->
|
||||
<div id="pageheader">
|
||||
<div class="title"><a href="http://www.arduino.cc"/>Arduino</a></div>
|
||||
<div class="search">
|
||||
<!-- SiteSearch Google -->
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<INPUT TYPE=text name=q size=25 maxlength=255 value="">
<INPUT type=submit name=btnG VALUE="search">
<input type=hidden name=domains value="http://www.arduino.cc/">
|
||||
<input type=hidden name=sitesearch value="http://www.arduino.cc/">
|
||||
</FORM>
<!-- SiteSearch Google -->
|
||||
</div>
|
||||
</div>
|
||||
<!--/PageHeaderFmt-->
|
||||
<!--PageLeftFmt-->
|
||||
<div id="pagenav" style="text-align: right">
|
||||
<div style="float: left;">
|
||||
<p><a class='wikilink' href='http://arduino.cc/en/Main/Buy'>Buy</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Software'>Download</a>
|
||||
|
|
||||
<a class='wikilink' href='Guide_index.html'>Getting Started</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Tutorial/HomePage'>Learning</a>
|
||||
|
|
||||
<a class='wikilink' href='index.html'>Reference</a>
|
||||
|
|
||||
<a class='wikilink' href='http://arduino.cc/en/Main/Hardware'>Hardware</a>
|
||||
|
|
||||
<a class='wikilink' href='FAQ.html'>FAQ</a>
|
||||
</p>
|
||||
<p class='vspace'></p>
|
||||
|
||||
</div>
|
||||
<a class="urllink" href="http://www.arduino.cc/blog/" rel="nofollow">Blog »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl" rel="nofollow">Forum »</a> |
|
||||
<a class="urllink" href="http://www.arduino.cc/playground/" rel="nofollow">Playground »</a>
|
||||
</div>
|
||||
<!--/PageLeftFmt-->
|
||||
<div id="pagetext">
|
||||
<!--PageText-->
|
||||
<div id='wikitext'>
|
||||
<p><strong>Reference</strong> <a class='wikilink' href='index.html'>Language</a> (<a class='wikilink' href='Extended.html'>extended</a>) | <a class='selflink' href='Libraries.html'>Libraries</a> | <a class='wikilink' href='Comparison.html'>Comparison</a> | <a class='wikilink' href='Changes.html'>Changes</a>
|
||||
</p>
|
||||
<p class='vspace'></p><h2>Libraries</h2>
|
||||
<p>To use a library in a sketch, select it from <strong>Sketch > Import Library</strong>. For details, see the page on <a class='wikilink' href='Guide_Environment#libraries.html'>the Arduino environment</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><h3>Standard Libraries</h3>
|
||||
<ul><li><a class='wikilink' href='EEPROM.html'>EEPROM</a> - reading and writing to "permanent" storage
|
||||
</li><li><a class='wikilink' href='Ethernet.html'>Ethernet</a> - for connecting to the internet using the Arduino Ethernet Shield
|
||||
</li><li><a class='wikilink' href='Firmata.html'>Firmata</a> - for communicating with applications on the computer using a standard serial protocol.
|
||||
</li><li><a class='wikilink' href='LiquidCrystal.html'>LiquidCrystal</a> - for controlling liquid crystal displays (<span class='wikiword'>LCDs</span>)
|
||||
</li><li><a class='wikilink' href='Servo.html'>Servo</a> - for controlling servo motors
|
||||
</li><li><a class='wikilink' href='SoftwareSerial.html'>SoftwareSerial</a> - for serial communication on any digital pins
|
||||
</li><li><a class='wikilink' href='Stepper.html'>Stepper</a> - for controlling stepper motors
|
||||
</li><li><a class='wikilink' href='Wire.html'>Wire</a> - Two Wire Interface (<span class='wikiword'>TWI/I2C</span>) for sending and receiving data over a net of devices or sensors.
|
||||
</li></ul><p class='vspace'></p><p>These libraries are compatible Wiring versions, and the links below point to the (excellent) Wiring documentation.
|
||||
</p>
|
||||
<p class='vspace'></p><ul><li><a class='urllink' href='http://wiring.org.co/reference/libraries/Matrix/index.html' rel='nofollow'>Matrix</a> - Basic LED Matrix display manipulation library
|
||||
</li><li><a class='urllink' href='http://wiring.org.co/reference/libraries/Sprite/index.html' rel='nofollow'>Sprite</a> - Basic image sprite manipulation library for use in animations with an LED matrix
|
||||
</li></ul><p class='vspace'></p><h3>Contributed Libraries</h3>
|
||||
<p>To install a contributed library, unzip it to the <strong>libraries</strong> sub-folder of your sketchbook. For details, see the page on <a class='wikilink' href='Guide_Environment#libraries.html'>the Arduino environment</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><p>Communication (networking and protocols):
|
||||
</p><ul><li><a class='urllink' href='http://www.arduino.cc/playground/Code/Messenger' rel='nofollow'>Messenger</a> - for processing text-based messages from the computer
|
||||
</li><li><a class='urllink' href='http://sundial.org/arduino/index.php/newsoftserial/' rel='nofollow'>NewSoftSerial</a> - an improved version of the <span class='wikiword'>SoftwareSerial</span> library
|
||||
</li><li><a class='urllink' href='http://www.arduino.cc/playground/Learning/OneWire' rel='nofollow'>OneWire</a> - control devices (from Dallas Semiconductor) that use the One Wire protocol.
|
||||
</li><li><a class='urllink' href='http://www.arduino.cc/playground/Main/PS2Keyboard' rel='nofollow'>PS2Keyboard</a> - read characters from a <span class='wikiword'>PS2</span> keyboard.
|
||||
</li><li><a class='urllink' href='http://www.arduino.cc/playground/Code/SimpleMessageSystem' rel='nofollow'>Simple Message System</a> - send messages between Arduino and the computer
|
||||
</li><li><a class='urllink' href='http://code.google.com/p/sserial2mobile/' rel='nofollow'>SSerial2Mobile</a> - send text messages or emails using a cell phone (via AT commands over software serial)
|
||||
</li><li><a class='urllink' href='http://code.google.com/p/webduino/' rel='nofollow'>Webduino</a> - extensible web server library (for use with the Arduino Ethernet Shield)
|
||||
</li><li><a class='wikilink' href='http://arduino.cc/en/Tutorial/X10'>X10</a> - Sending X10 signals over AC power lines
|
||||
</li><li><a class='urllink' href='http://code.google.com/p/xbee-arduino/' rel='nofollow'>XBee</a> - for communicating with <span class='wikiword'>XBees</span> in API mode
|
||||
</li><li><a class='urllink' href='http://www.arduino.cc/playground/Code/SerialControl' rel='nofollow'>SerialControl</a> - Remote control other Arduinos over a serial connection
|
||||
</li></ul><p class='vspace'></p><p>Sensing:
|
||||
</p><ul><li><a class='urllink' href='http://www.arduino.cc/playground/Main/CapSense' rel='nofollow'>Capacitive Sensing</a> - turn two or more pins into capacitive sensors
|
||||
</li><li><a class='urllink' href='http://www.arduino.cc/playground/Code/Debounce' rel='nofollow'>Debounce</a> - for reading noisy digital inputs (e.g. from buttons)
|
||||
</li></ul><p class='vspace'></p><p>Displays and <span class='wikiword'>LEDs</span>:
|
||||
</p><ul><li><a class='urllink' href='http://web.alfredstate.edu/weimandn/arduino/LiquidCrystal_library/LiquidCrystal_index.html' rel='nofollow'>Improved LCD library</a> fixes LCD initialization bugs in official Arduino LCD library
|
||||
</li><li><a class='urllink' href='http://www.arduino.cc/playground/Code/GLCDks0108' rel='nofollow'>GLCD</a> - graphics routines for LCD based on the <span class='wikiword'>KS0108</span> or equivalent chipset.
|
||||
</li><li><a class='urllink' href='http://www.arduino.cc/playground/Main/LedControl' rel='nofollow'>LedControl</a> - for controlling LED matrices or seven-segment displays with a <span class='wikiword'>MAX7221</span> or <span class='wikiword'>MAX7219</span>.
|
||||
</li><li><a class='urllink' href='http://www.wayoda.org/arduino/ledcontrol/index.html' rel='nofollow'>LedControl</a> - an alternative to the Matrix library for driving multiple <span class='wikiword'>LEDs</span> with Maxim chips.
|
||||
</li><li><a class='urllink' href='http://www.arduino.cc/playground/Main/LedDisplay' rel='nofollow'>LedDisplay</a> - control of a <a class='urllink' href='http://sigma.octopart.com/23295/datasheet/Avago-HCMS-2973.pdf' rel='nofollow'>HCMS-29xx</a> scrolling LED display.
|
||||
</li></ul><p class='vspace'></p><p>Frequency Generation and Audio:
|
||||
</p><ul><li><a class='urllink' href='http://code.google.com/p/arduino-tone/' rel='nofollow'>Tone</a> - generate audio frequency square waves in the background on any microcontroller pin
|
||||
</li></ul><p class='vspace'></p><p>Motors and PWM:
|
||||
</p><ul><li><a class='urllink' href='http://www.arduino.cc/playground/Learning/TLC5940' rel='nofollow'>TLC5940</a> - 16 channel 12 bit PWM controller.
|
||||
</li></ul><p class='vspace'></p><p>Timing:
|
||||
</p><ul><li><a class='urllink' href='http://www.arduino.cc/playground/Code/DateTime' rel='nofollow'>DateTime</a> - a library for keeping track of the current date and time in software.
|
||||
</li><li><a class='urllink' href='http://www.arduino.cc/playground/Code/Metro' rel='nofollow'>Metro</a> - help you time actions at regular intervals
|
||||
</li><li><a class='urllink' href='http://www.arduino.cc/playground/Main/MsTimer2' rel='nofollow'>MsTimer2</a> - uses the timer 2 interrupt to trigger an action every N milliseconds.
|
||||
</li></ul><p class='vspace'></p><p>Utilities:
|
||||
</p><ul><li><a class='wikilink' href='http://arduino.cc/en/Tutorial/TextString'>TextString</a> aka <a class='wikilink' href='http://arduino.cc/en/Tutorial/TextString'>String</a> - handle strings
|
||||
</li><li><a class='urllink' href='http://sundial.org/arduino/index.php/pstring/' rel='nofollow'>PString</a> - a lightweight class for printing to buffers
|
||||
</li><li><a class='urllink' href='http://arduiniana.org/libraries/streaming/' rel='nofollow'>Streaming</a> - a method to simplify print statements
|
||||
</li></ul><p class='vspace'></p><p>For a guide to writing your own libraries, see <a class='wikilink' href='http://arduino.cc/en/Hacking/LibraryTutorial'>this tutorial</a>.
|
||||
</p>
|
||||
<p class='vspace'></p><p><a class='wikilink' href='index.html'>Reference Home</a>
|
||||
</p>
|
||||
<p class='vspace'></p><p><em>Corrections, suggestions, and new documentation should be posted to the <a class='urllink' href='http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?board=swbugs' rel='nofollow'>Forum</a>.</em>
|
||||
</p>
|
||||
<p class='vspace'></p><p>The text of the Arduino reference is licensed under a
|
||||
<a class='urllink' href='http://creativecommons.org/licenses/by-sa/3.0/' rel='nofollow'>Creative Commons Attribution-ShareAlike 3.0 License</a>. Code samples in the reference are released into the public domain.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!--PageFooterFmt-->
|
||||
<div id="pagefooter">
|
||||
<a href='#'>Edit Page</a> | <a href='#'>Page History</a> | <a href='#' target='_blank'>Printable View</a> | <a href='http://arduino.cc/en/Site/AllRecentChanges'>All Recent Site Changes</a>
|
||||
</div>
|
||||
<!--/PageFooterFmt-->
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue