user67198: hello guys i want to ask about 2 things
first one is i'm connecting and arduino uno attached to a usb host sheild and transferring data of a mouse coordinates to 10 arduino leonardo
i'm using the standard speed 100
normal mode
my wires is all about 10 cm long

i need to speed up the comm to fast mode
how to make this ? and the line of code where to put it in the code and in the master or slave ?

what about the pull-up resistors ? does arduino uno includes built in pull-up resistors ? does it needs to disable it and put my own pull up resistors ?
i’m using wire library



user4143: 
i need to speed up the comm to fast mode how to make this

Wire.setClock(400000);


and the line of code where to put it in the code

Just after Wire.begin() in setup().  Wire.begin() sets the speed to 100,000 and you need to then override that afterwards to set it to 400,000 (or whatever speed you want to run at).

and in the master or slave ?

In the master, since it's the master that generates the clock.

what about the pull-up resistors ? does arduino uno includes built in pull-up resistors ?

Yes, but they're too high for reliable I2C operation. You should add your own resistors in the region of 1kΩ.

does it needs to disable it and put my own pull up resistors ?

No, yours will just be in parallel with them, with the net result of a small reduction of overall resistance.

67198: <p>hello guys i want to ask about 2 things
first one is i'm connecting and arduino uno attached to a usb host sheild and transferring data of a mouse coordinates to 10 arduino leonardo
i'm using the standard speed 100
normal mode
my wires is all about 10 cm long</p>
<ol>
<li><p>i need to speed up the comm to fast mode
how to make this ? and the line of code where to put it in the code and in the master or slave ?</p>
</li>
<li><p>what about the pull-up resistors ? does arduino uno includes built in pull-up resistors ? does it needs to disable it and put my own pull up resistors ?
i’m using wire library</p>
</li>
</ol>
 4143: <blockquote>
<p>i need to speed up the comm to fast mode how to make this</p>
</blockquote>
<pre><code>Wire.setClock(400000);
</code></pre>
<blockquote>
<p>and the line of code where to put it in the code</p>
</blockquote>
<p>Just after <code>Wire.begin()</code> in <code>setup()</code>.  <code>Wire.begin()</code> sets the speed to 100,000 and you need to then override that afterwards to set it to 400,000 (or whatever speed you want to run at).</p>
<blockquote>
<p>and in the master or slave ?</p>
</blockquote>
<p>In the master, since it's the master that generates the clock.</p>
<blockquote>
<p>what about the pull-up resistors ? does arduino uno includes built in pull-up resistors ?</p>
</blockquote>
<p>Yes, but they're too high for reliable I2C operation. You should add your own resistors in the region of 1kΩ.</p>
<blockquote>
<p>does it needs to disable it and put my own pull up resistors ?</p>
</blockquote>
<p>No, yours will just be in parallel with them, with the net result of a small reduction of overall resistance.</p>
