<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-cn">
		<id>http://wiki.ywrobot.net/index.php?action=history&amp;feed=atom&amp;title=Wiring_shift.c</id>
		<title>Wiring shift.c - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.ywrobot.net/index.php?action=history&amp;feed=atom&amp;title=Wiring_shift.c"/>
		<link rel="alternate" type="text/html" href="http://wiki.ywrobot.net/index.php?title=Wiring_shift.c&amp;action=history"/>
		<updated>2026-05-14T11:01:46Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://wiki.ywrobot.net/index.php?title=Wiring_shift.c&amp;diff=60&amp;oldid=prev</id>
		<title>YWrobot CYB：创建页面，内容为“&lt;pre style=&quot;color:blue&quot;&gt; /*   wiring_shift.c - shiftOut() function   Part of Arduino - http://www.arduino.cc/    Copyright (c) 2005-2006 David A. Mellis    This libr...”</title>
		<link rel="alternate" type="text/html" href="http://wiki.ywrobot.net/index.php?title=Wiring_shift.c&amp;diff=60&amp;oldid=prev"/>
				<updated>2016-04-25T02:01:47Z</updated>
		
		<summary type="html">&lt;p&gt;创建页面，内容为“&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt; /*   wiring_shift.c - shiftOut() function   Part of Arduino - http://www.arduino.cc/    Copyright (c) 2005-2006 David A. Mellis    This libr...”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre style=&amp;quot;color:blue&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
  wiring_shift.c - shiftOut() function&lt;br /&gt;
  Part of Arduino - http://www.arduino.cc/&lt;br /&gt;
&lt;br /&gt;
  Copyright (c) 2005-2006 David A. Mellis&lt;br /&gt;
&lt;br /&gt;
  This library is free software; you can redistribute it and/or&lt;br /&gt;
  modify it under the terms of the GNU Lesser General Public&lt;br /&gt;
  License as published by the Free Software Foundation; either&lt;br /&gt;
  version 2.1 of the License, or (at your option) any later version.&lt;br /&gt;
&lt;br /&gt;
  This library is distributed in the hope that it will be useful,&lt;br /&gt;
  but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU&lt;br /&gt;
  Lesser General Public License for more details.&lt;br /&gt;
&lt;br /&gt;
  You should have received a copy of the GNU Lesser General&lt;br /&gt;
  Public License along with this library; if not, write to the&lt;br /&gt;
  Free Software Foundation, Inc., 59 Temple Place, Suite 330,&lt;br /&gt;
  Boston, MA  02111-1307  USA&lt;br /&gt;
&lt;br /&gt;
  $Id: wiring.c 248 2007-02-03 15:36:30Z mellis $&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;wiring_private.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder) {&lt;br /&gt;
	uint8_t value = 0;&lt;br /&gt;
	uint8_t i;&lt;br /&gt;
&lt;br /&gt;
	for (i = 0; i &amp;lt; 8; ++i) {&lt;br /&gt;
		digitalWrite(clockPin, HIGH);&lt;br /&gt;
		if (bitOrder == LSBFIRST)&lt;br /&gt;
			value |= digitalRead(dataPin) &amp;lt;&amp;lt; i;&lt;br /&gt;
		else&lt;br /&gt;
			value |= digitalRead(dataPin) &amp;lt;&amp;lt; (7 - i);&lt;br /&gt;
		digitalWrite(clockPin, LOW);&lt;br /&gt;
	}&lt;br /&gt;
	return value;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val)&lt;br /&gt;
{&lt;br /&gt;
	uint8_t i;&lt;br /&gt;
&lt;br /&gt;
	for (i = 0; i &amp;lt; 8; i++)  {&lt;br /&gt;
		if (bitOrder == LSBFIRST)&lt;br /&gt;
			digitalWrite(dataPin, !!(val &amp;amp; (1 &amp;lt;&amp;lt; i)));&lt;br /&gt;
		else	&lt;br /&gt;
			digitalWrite(dataPin, !!(val &amp;amp; (1 &amp;lt;&amp;lt; (7 - i))));&lt;br /&gt;
			&lt;br /&gt;
		digitalWrite(clockPin, HIGH);&lt;br /&gt;
		digitalWrite(clockPin, LOW);		&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>YWrobot CYB</name></author>	</entry>

	</feed>