<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: shiftIn for wirish_shift.cpp</title>
		<link>http://forums.leaflabs.com/topic.php?id=1506</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:08:50 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=1506" rel="self" type="application/rss+xml" />

		<item>
			<title>manitou on "shiftIn for wirish_shift.cpp"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1506#post-9908</link>
			<pubDate>Mon, 26 Mar 2012 16:20:19 +0000</pubDate>
			<dc:creator>manitou</dc:creator>
			<guid isPermaLink="false">9908@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Well, to match up with Arduino shiftin/out API, here is shiftIn() that could be added to wirish_shift.cpp.  One might also update io.h&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;uint8 shiftIn(uint8 dataPin, uint8 clockPin, uint8 bitOrder) {
    uint8 value = 0;
    uint8 i;

    for (i = 0; i &#38;lt; 8; ++i) {
        digitalWrite(clockPin, HIGH);
        if (bitOrder == LSBFIRST)
            value &#124;= digitalRead(dataPin) &#38;lt;&#38;lt; i;
        else
            value &#124;= digitalRead(dataPin) &#38;lt;&#38;lt; (7 - i);
        digitalWrite(clockPin, LOW);
    }
    return value;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
