Libraries
\ Wire
Reference for Wiring version 1.0 Build 0100+ If you have a previous version, use the reference included with your software. If see any errors or have any comments, let us know.
Name |
Wire |
Examples |
#include "Wire.h"
void setup()
{
Wire.begin();
Serial.begin(9600);
}
void loop()
{
Wire.requestFrom(2, 6);
while(Wire.available())
{
char c = Wire.read();
Serial.print(c);
}
delay(500);
}
#include "Wire.h"
void setup()
{
Wire.begin(4);
Wire.onReceive(receiveEvent);
Serial.begin(9600);
}
void loop()
{
delay(100);
}
void receiveEvent(int howMany)
{
while(1 < Wire.available())
{
char c = Wire.read();
Serial.print(c);
}
int x = Wire.read();
Serial.println(x);
}
|
Description |
There is a TWI (Two Wire Interface) port available on the Wiring board named Wire. On Wiring v1 boards the SCL and SDA pins are: 0 and 1.
On Wiring S board the SCL and SDA pins are: 8 and 9. |
Syntax |
Wire
|
Methods |
|
Parameters |
Wire |
The hardware TWI port |
|
Returns |
None |
Usage |
Application |
Updated on July 07, 2011 11:12:02pm PDT