<?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: trying to use wire...</title>
		<link>http://forums.leaflabs.com/topic.php?id=1084</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:23:52 +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=1084" rel="self" type="application/rss+xml" />

		<item>
			<title>poslathian on "trying to use wire..."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1084#post-6829</link>
			<pubDate>Tue, 11 Oct 2011 17:37:16 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">6829@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;you might also check out the example from here:&#60;br /&#62;
&#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=1109&#34; rel=&#34;nofollow&#34;&#62;http://forums.leaflabs.com/topic.php?id=1109&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mbolivar on "trying to use wire..."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1084#post-6693</link>
			<pubDate>Fri, 30 Sep 2011 05:04:52 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">6693@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;hi eddiea6897,&#60;/p&#62;
&#60;p&#62;when you say you can't read/write, do you mean you get nothing/garbage data back, or that the signals aren't coming out on the pins correctly?&#60;/p&#62;
&#60;p&#62;the wire library is... okay, but not super reliable.  we put it in as a stopgap measure while we were developing hardware i2c.  crenn has a much improved version that you might want to try:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=1033#post-6321&#34; rel=&#34;nofollow&#34;&#62;http://forums.leaflabs.com/topic.php?id=1033#post-6321&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>eddiea6897 on "trying to use wire..."</title>
			<link>http://forums.leaflabs.com/topic.php?id=1084#post-6688</link>
			<pubDate>Fri, 30 Sep 2011 01:18:58 +0000</pubDate>
			<dc:creator>eddiea6897</dc:creator>
			<guid isPermaLink="false">6688@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;in my attempts , with my limited understanding , to use the wire library to write to an External EEPROM, no real use for it but just trying to learn ym way around the board through experiments , i cannot read and im guessing nor write to the chip&#60;br /&#62;
datasheet : &#60;a href=&#34;http://ww1.microchip.com/downloads/en/devicedoc/21203m.pdf&#34; rel=&#34;nofollow&#34;&#62;http://ww1.microchip.com/downloads/en/devicedoc/21203m.pdf&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;using the following code which i think its pretty straight forward in terms of how the data is sent and what the chip expects.&#60;br /&#62;
begin transmission send high adress followed by low followed by my data then end transmission. I am also assuming wire takes care of the  read/write bits?&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;#include &#38;lt;Wire.h&#38;gt;

int stuff = 255 ;
byte high = 0x00;
byte low = 0x00;
void setup()
{
 Wire.begin(9,5);
 SerialUSB.println(&#38;quot;Initiating...&#38;quot;);
 pinMode(2, OUTPUT);
 digitalWrite(2, HIGH);
}

void loop()
{
  sendData(stuff);
  delay(5000);
  SerialUSB.println(readData());

}
void sendData(int data)
{

  Wire.beginTransmission(0B1010000); // can also be written in Hex: 0x50
  Wire.send(high);
  Wire.send(low);
  Wire.send(data);
  Wire.endTransmission();

}
 byte readData()
 {

  Wire.beginTransmission(0B1010000); // can also be written in Hex: 0x50
  Wire.send(high);
  Wire.send(low);

  Wire.endTransmission();
  Wire.requestFrom(0B1010000, 1);
  return Wire.receive();
 }&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
