Skip to content
Browse files

Update doc/getting-started-with-i2c.md

It seems like the write_bytes and read methods were renamed (which doesn't make much sense, but hey)

>>> dir(quick2wire.i2c)
[<snip> 'reading', 'reading_into', 'sizeof', 'string_at', 'writing', 'writing_bytes']
  • Loading branch information...
1 parent 482a9a1 commit 30abe4a756ca2875274fe5046da23c2449c39593 @omerk omerk committed Aug 1, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 doc/getting-started-with-i2c.md
View
12 doc/getting-started-with-i2c.md
@@ -76,16 +76,16 @@ single write operation that writes two bytes: the register to
write to and the value of the register.
bus.transaction(
- i2c.write_bytes(address, iodir_register, 0xFF))
+ i2c.writing_bytes(address, iodir_register, 0xFF))
Then we'll read the value of the chip's GPIO register by performing a
transaction containing two operations: a write operation that tells
the chip which register we want to read, and a read operation that
reads a single byte from that register.
read_results = bus.transaction(
- i2c.write_bytes(address, gpio_register),
- i2c.read(address, 1))
+ i2c.writing_bytes(address, gpio_register),
+ i2c.reading(address, 1))
The I2CMaster' transaction method returns a list of byte sequences, one
for each read operation performed. Each result is an array of bytes
@@ -110,11 +110,11 @@ Putting it all together:
with i2c.I2CMaster() as bus:
bus.transaction(
- i2c.write_bytes(address, iodir_register, 0xFF))
+ i2c.writing_bytes(address, iodir_register, 0xFF))
read_results = bus.transaction(
- i2c.write_bytes(address, gpio_register),
- i2c.read(address, 1))
+ i2c.writing_bytes(address, gpio_register),
+ i2c.reading(address, 1))
gpio_state = read_results[0][0]

0 comments on commit 30abe4a

Please sign in to comment.
Something went wrong with that request. Please try again.