You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
212 lines
15 KiB
HTML
212 lines
15 KiB
HTML
15 years ago
|
<!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' />
|
||
|
</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>Introduction to the Arduino Environment</h2>
|
||
|
<table width='100%' border='0' cellpadding='5' cellspacing='0'><tr><td width='50%' valign='top'>
|
||
|
<p class='vspace'></p><h3>Toolbar</h3>
|
||
|
<p><em>Verify/Compile</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/play.gif' alt='' title='' /></div>
|
||
|
<p class='vspace'></p><p>Checks your code for errors.
|
||
|
</p>
|
||
|
<p class='vspace'></p><p><em>Stop</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/stop.gif' alt='' title='' /></div>
|
||
|
<p class='vspace'></p><p>Stops the serial monitor, or unhighlight other buttons.
|
||
|
</p>
|
||
|
<p class='vspace'></p><p><em>New</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/new.gif' alt='' title='' /></div>
|
||
|
<p class='vspace'></p><p>Creates a new sketch.
|
||
|
</p>
|
||
|
<p class='vspace'></p><p><em>Open</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/open.gif' alt='' title='' /></div>
|
||
|
<p class='vspace'></p><p>Presents a menu of all the sketches in your sketchbook. 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><p><em>Save</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/save.gif' alt='' title='' /></div>
|
||
|
<p class='vspace'></p><p>Saves your sketch.
|
||
|
</p>
|
||
|
<p class='vspace'></p><p><em>Upload to I/O Board</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/export.gif' alt='' title='' /></div>
|
||
|
<p class='vspace'></p><p>Uploads your code to the Arduino I/O board. Make sure to save or verify your sketch before uploading it.
|
||
|
</p>
|
||
|
<p class='vspace'></p><p><em>Serial Monitor</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><div><img src='http://arduino.cc/en/uploads/Guide/serial_monitor.gif' alt='' title='' /></div>
|
||
|
<p class='vspace'></p><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><h4>Tab Menu</h4>
|
||
|
<div><img src='http://arduino.cc/en/uploads/Guide/tabs.gif' alt='' title='' /></div>
|
||
|
<p class='vspace'></p><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). See the <a class='wikilink' href='http://arduino.cc/en/Hacking/BuildProcess'>description of the build process</a> for details of how these are handled.
|
||
|
</p>
|
||
|
<p class='vspace'></p></td><td width='50%' valign='top'>
|
||
|
<p class='vspace'></p><h3>Menus</h3>
|
||
|
<h4>Sketch</h4>
|
||
|
<p><em>Verify/Compile</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>Checks your sketch for errors.
|
||
|
</p>
|
||
|
<p class='vspace'></p><p><em>Import Library</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>Uses a library in your sketch. Works by adding <strong>#include</strong>s to the top of your code. This makes extra functionality available to your sketch, but increases its size. To stop using a library, delete the appropriate <strong>#include</strong>s from the top of your sketch. For more details, see the page on <a class='wikilink' href='Libraries.html'>Libraries</a>.
|
||
|
</p>
|
||
|
<p class='vspace'></p><p><em>Show Sketch Folder</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>Opens the sketch folder on the desktop.
|
||
|
</p>
|
||
|
<p class='vspace'></p><p><em>Add File...</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>Adds another source file to the sketch. The new file appears in a new tab in the sketch window. This facilitates and larger projects with multiple source files. Files can be removed from a sketch using the tab menu.
|
||
|
</p>
|
||
|
<p class='vspace'></p><h4>Tools</h4>
|
||
|
<p><em>Auto Format</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>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>
|
||
|
<p class='vspace'></p><p><em>Copy for Discourse</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>Copies the code of your sketch to the clipboard in a forum suitable for posting to the forum, complete with syntax coloring.
|
||
|
</p>
|
||
|
<p class='vspace'></p><p><em>Copy as HTML</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>Copies the code of your sketch to the clipboard as HTML, suitable for embedding in web pages.
|
||
|
</p>
|
||
|
<p class='vspace'></p><p><em>Board</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>Select the board that you're using. This controls the way that your sketch is compiled and uploaded as well as the behavior of the Burn Bootloader menu items. <em>See below for details.</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p><em>Serial Port</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>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>
|
||
|
<p class='vspace'></p><p>Before uploading your sketch, you need to select the item from this menu that represents your Arduino board. On the Mac, this 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.
|
||
|
</p>
|
||
|
<p class='vspace'></p><p><em>Burn Bootloader</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>The items in this menu allow you to burn a <a class='wikilink' href='http://arduino.cc/en/Hacking/Bootloader'>bootloader</a> onto your board with a variety of programmers. This is not required for normal use of an Arduino board, but may be useful if you purchase additional <span class='wikiword'>ATmega</span>'s or are building a board yourself. Ensure that you've selected the correct board from the Boards menu beforehand. To burn a bootloader with the AVR ISP, you need to select the item corresponding to your programmer from the Serial Port menu. Instructions are available for building a <a class='wikilink' href='http://arduino.cc/en/Main/ParallelProgrammer'>parallel programmer</a>.
|
||
|
</p>
|
||
|
<p class='vspace'></p></td></tr></table>
|
||
|
<p class='vspace'></p><h3>Board Descriptions</h3>
|
||
|
<p><em>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.</em>
|
||
|
</p>
|
||
|
<p class='vspace'></p>
|
||
|
<table width='100%' border='0' cellpadding='5' cellspacing='0'><tr><td width='50%' valign='top'>
|
||
|
<p class='vspace'></p><p><strong>Arduino Duemilanove w/ <span class='wikiword'>ATmega328</span></strong>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>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>
|
||
|
<p class='vspace'></p><p><strong>Arduino Diecimila or Duemilanove w/ <span class='wikiword'>ATmega168</span></strong>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>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>
|
||
|
<p class='vspace'></p><p><strong>Arduino Mega</strong>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>An <span class='wikiword'>ATmega1280</span> running at 16 <span class='wikiword'>MHz</span> with auto-reset.
|
||
|
</p>
|
||
|
<p class='vspace'></p><p><strong>Arduino Mini</strong>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>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>
|
||
|
<p class='vspace'></p><p><strong>Arduino Nano</strong>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>Equivalent to Arduino Diecimila or Duemilanove w/ <span class='wikiword'>ATmega168</span> (i.e. an <span class='wikiword'>ATmega168</span> running at 16 <span class='wikiword'>MHz</span> with auto-reset).
|
||
|
</p>
|
||
|
<p class='vspace'></p><p><strong>Arduino BT</strong>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p><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>
|
||
|
<p class='vspace'></p></td><td width='50%' valign='top'>
|
||
|
<p class='vspace'></p><p><strong><span class='wikiword'>LilyPad</span> Arduino w/ <span class='wikiword'>ATmega328</span></strong>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>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>
|
||
|
<p class='vspace'></p><p><strong><span class='wikiword'>LilyPad</span> Arduino w/ <span class='wikiword'>ATmega168</span></strong>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>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.
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>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>
|
||
|
<p class='vspace'></p><p><strong>Arduino Pro or Pro Mini (3.3V, 8 <span class='wikiword'>MHz</span>) w/ <span class='wikiword'>ATmega328</span></strong>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>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>
|
||
|
<p class='vspace'></p><p><strong>Arduino Pro or Pro Mini (3.3V, 8 <span class='wikiword'>MHz</span>) w/ <span class='wikiword'>ATmega168</span></strong>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>An <span class='wikiword'>ATmega168</span> running at 8 <span class='wikiword'>MHz</span> (3.3V) with auto-reset.
|
||
|
</p>
|
||
|
<p class='vspace'></p><p><strong>Arduino NG or older w/ <span class='wikiword'>ATmega168</span></strong>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>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>
|
||
|
<p class='vspace'></p><p><strong>Arduino NG or older w/ <span class='wikiword'>ATmega8</span></strong>
|
||
|
</p>
|
||
|
<p class='vspace'></p><p>An <span class='wikiword'>ATmega8</span> running at 16 <span class='wikiword'>MHz</span> <em>without</em> auto-reset.
|
||
|
</p>
|
||
|
<p class='vspace'></p></td></tr></table>
|
||
|
<p class='vspace'></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 <a class='wikilink' href='http://arduino.cc/en/Hacking/Preferences'>preference files</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_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>
|