90 lines
6.1 KiB
HTML
90 lines
6.1 KiB
HTML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:lastBlockDepth="6" MadCap:lastHeight="94" MadCap:lastWidth="853" MadCap:disableMasterStylesheet="true" MadCap:tocPath="" MadCap:InPreviewMode="false" MadCap:PreloadImages="false" MadCap:RuntimeFileType="Topic" MadCap:TargetType="WebHelp" lang="en-us" xml:lang="en-us" MadCap:PathToHelpSystem="../../../" MadCap:HelpSystemFileName="Default.xml" MadCap:SearchType="Stem">
|
|
<head><title>MAINIO</title>
|
|
<link href="../../SkinSupport/MadCap.css" rel="stylesheet" />
|
|
<link href="../../Resources/Stylesheets/BSE_Help.css" rel="stylesheet" />
|
|
<script src="../../SkinSupport/MadCapAll.js" type="text/javascript">
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<h1 class="code">MAINIO</h1>
|
|
<div class="ImagePlusCaption">
|
|
<div class="Col2">
|
|
<p>
|
|
<img src="../../graphics/pgm_icon2p.gif" border="0" alt="BS2p icon" title="BS2p icon" /> (BS2p40)</p>
|
|
</div>
|
|
<p style="text-align: right;"><a href="../ExampleTopics/AuMainIotermEx.htm" target="" title="" alt="" class="MCXref_0" xrefformat="{paratext}">AUXIO / MAINIO / IOTERM Example</a>
|
|
</p>
|
|
<p> </p>
|
|
</div>
|
|
<p class="clear"> </p>
|
|
<p> </p>
|
|
<p class="PlainText">Syntax: <span class="keyword_in_text">MAINIO</span></p>
|
|
<h2>Function</h2>
|
|
<p>Switch from control of auxiliary I/O pins to main I/O pins (on the BS2p40 only).</p>
|
|
<h2>Quick Facts</h2>
|
|
<table width="100%" cellpadding="4" cellspacing="0" border="1">
|
|
<tr bgcolor="#CFCFCF">
|
|
<td width="15%" align="center"> </td>
|
|
<td width="85%" align="center">BS2p / BS2pe / BS2px</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" bgcolor="#CFCFCF">I/O Pin IDs</td>
|
|
<td>0 - 15 (just like auxiliary I/O, but after <span class="keyword_in_text">MAINIO</span> command, all
|
|
references affect physical pins 5 - 20).</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" bgcolor="#CFCFCF">Special Notes</td>
|
|
<td>
|
|
<p>Command is accepted by the 24-pin BS2p, BS2pe, and BS2px, but only the 40-pin BS2p40 gives access to the auxiliary I/O pins.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td align="center" bgcolor="#CFCFCF">Related Commands</td>
|
|
<td align="center" colspan="1">
|
|
<p colspan="1" align="center"><a href="AUXIO.htm" target="" title="" alt="" class="MCXref_0" xrefformat="{paratext}">AUXIO</a>, <a href="IOTERM.htm" target="" title="" alt="" class="MCXref_0" xrefformat="{paratext}">IOTERM</a></p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h2>Explanation</h2>
|
|
<p class="PlainText">The BS2p, BS2pe, and BS2px is available as a 24-pin module that is pin-compatible with the BS2, BS2e, and BS2sx. Also availabe is a 40-pin module called the BS2p40 with an additional 16 I/O pins (for a total of 32). The BS2p40's extra, or auxiliary, I/O pins can be accessed in the same manner as the main I/O pins (by using the IDs 0 to 15) but only after issuing an <span class="keyword_in_text">AUXIO</span> or <span class="keyword_in_text">IOTERM 1</span> command. The <span class="keyword_in_text">MAINIO</span> command causes the BASIC Stamp to affect the main I/O pins (the default) instead of the auxiliary I/O pins in all further code until the <span class="keyword_in_text">AUXIO</span> or <span class="keyword_in_text">IOTERM 1</span> command is reached, or the BASIC Stamp is reset or power-cycled.</p>
|
|
<p class="PlainText">The following example illustrates this:<br></br></p><pre class="BScode" xml:space="preserve">
|
|
AUXIO
|
|
HIGH 0
|
|
MAINIO
|
|
LOW 0
|
|
</pre>
|
|
<p class="PlainText">The first line of the above example will tell the BASIC Stamp to affect the auxiliary I/O pins in the commands following it. Line 2 sets I/O pin 0 of the auxiliary I/O pins (physical pin 21) high. Afterward, the <span class="keyword_in_text">MAINIO </span>command tells the BASIC Stamp that all commands following it should affect the main I/O pins. The last command, <span class="keyword_in_text">LOW</span>, will set I/O pin 0 of the main I/O pins (physical pin 5) low.</p>
|
|
<p class="PlainText">Note that the main I/O and auxiliary I/O pins are independent of each other; the states of the main I/O pins remain unchanged while the program affects the auxiliary I/O pins, and vice versa.</p>
|
|
<div class="Col2">
|
|
<div class="MasterFoot">
|
|
<p MadCap:conditions="BSEconditions.BSEWebHelp (Primary)-INCLUDE"><a href="../../HomeTopics/HomePage.htm">Go to Welcome page</a>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<div class="Col2">
|
|
<div class="MasterFoot">
|
|
<p style="text-align: right;"><span class="ContactInfoProjectName">BASIC Stamp Help</span> <![CDATA[ ]]><span class="ContactInfoVersion#">Version 2.5.4</span> <![CDATA[ ]]></p>
|
|
<p style="text-align: right;">Copyright © <span class="ContactInfoCompanyName">Parallax Inc.</span></p>
|
|
<p style="text-align: right;"><span class="SystemShortDate">8/8/2012</span>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">/* <![CDATA[ */
|
|
|
|
var _gaq = _gaq || [];
|
|
_gaq.push(['_setAccount', 'UA-285614-1']);
|
|
_gaq.push(['_trackPageview']);
|
|
|
|
(function() {
|
|
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
|
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
|
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
|
})();
|
|
|
|
/* ]]> */</script>
|
|
<script type="text/javascript" src="../../SkinSupport/MadCapBodyEnd.js">
|
|
</script>
|
|
</body>
|
|
</html> |