瀏覽代碼

Update examples for legal I2C addresses

main
PaulStoffregen 8 年之前
父節點
當前提交
f19a946d8c
共有 4 個檔案被更改,包括 4 行新增4 行删除
  1. +1
    -1
      examples/master_reader/master_reader.ino
  2. +1
    -1
      examples/master_writer/master_writer.ino
  3. +1
    -1
      examples/slave_receiver/slave_receiver.ino
  4. +1
    -1
      examples/slave_sender/slave_sender.ino

+ 1
- 1
examples/master_reader/master_reader.ino 查看文件

@@ -20,7 +20,7 @@ void setup()

void loop()
{
Wire.requestFrom(2, 6); // request 6 bytes from slave device #2
Wire.requestFrom(8, 6); // request 6 bytes from slave device #8

while(Wire.available()) // slave may send less than requested
{

+ 1
- 1
examples/master_writer/master_writer.ino 查看文件

@@ -21,7 +21,7 @@ byte x = 0;

void loop()
{
Wire.beginTransmission(4); // transmit to device #4
Wire.beginTransmission(8); // transmit to device #8
Wire.write("x is "); // sends five bytes
Wire.write(x); // sends one byte
Wire.endTransmission(); // stop transmitting

+ 1
- 1
examples/slave_receiver/slave_receiver.ino 查看文件

@@ -14,7 +14,7 @@

void setup()
{
Wire.begin(4); // join i2c bus with address #4
Wire.begin(8); // join i2c bus with address #8
Wire.onReceive(receiveEvent); // register event
Serial.begin(9600); // start serial for output
}

+ 1
- 1
examples/slave_sender/slave_sender.ino 查看文件

@@ -14,7 +14,7 @@

void setup()
{
Wire.begin(2); // join i2c bus with address #2
Wire.begin(8); // join i2c bus with address #8
Wire.onRequest(requestEvent); // register event
}


Loading…
取消
儲存